Jerry Dollens • 00:01
Hello, my name is Jerry Dollins, and today we’re going to talk about how you can upload and process an Excel spreadsheet within the Itential Automation platform. Today we’ll be using a spreadsheet to submit a request to allocate a few IP addresses in NetBox. And then using our JSON forms, you’ll see how we can quickly provide a way for users to submit a spreadsheet when kicking off an automation. Then we’ll take a look at our workflow, where we’ll have a task to parse the spreadsheet data, and a transformation to prepare that data for NetBox. First, let’s take a look at our spreadsheet. Now our spreadsheet here is a simple IP request form, where we provide the hostname, desired address pool, and whether the allocated IP address should be marked as active or simply reserved in NetBox. Next, let’s navigate to Automation Studio and create our form.
Jerry Dollens • 00:53
We’ll click the plus icon in the upper left corner, and then select JSON Form from the drop-down. We’ll give the form a name, and then we’ll click Create. This will open up our new form. Now on the right-hand side, we have all of the available form elements that we can add. For today, we’re simply going to add a single element, a file upload. Drag and drop that on our form, and then we’ll configure the input. We’ll call this field IP Request, and since it’s the only input on the form, we’ll make it required.
Jerry Dollens • 01:24
Once we’ve added our field to the form, we can click the Preview button to see what the form looks like when presented to our user. Alright, let’s take a look at the workflow that will be kicked off using our form. The first step in our workflow is a query. This task is pulling the spreadsheet data out of the form input. Next we have the Excel to JSON task. This one converts our spreadsheet data to JSON. After that, we have a transformation, which is Itential’s low-code solution for data manipulation.
Jerry Dollens • 01:53
This transformation is taking in the parsed spreadsheet data and preparing it for use with NetBox. Looking at our transformation now, on the left-hand side, we’re taking in host data parsed from our spreadsheet, and we’re using this map function to turn it into the data we need to send to NetBox, shown on the right-hand side. Inside of our map function, we’re going through each row in our spreadsheet and converting it to the values we need. So we’re changing the names of our variables, and we’re also converting our status value to be all lowercase. In the end, what we’ll have is a list of IP address allocation requests, which we will use in our child job here. A child job allows us to nest one workflow within another, and in this case, run this nested workflow in a loop. And as you can see here, we are looping over that list of IP address allocation requests, and for each one, executing the assignNextIPAddressInPrefix workflow.
Jerry Dollens • 02:45
After that, the workflow takes the result of looping through our data and passes it to a Jinja template, taking JSON data and turning it into user-friendly data. We have one last query task, which extracts the result of our Jinja template. And then we have a manual task as our last step. Manual tasks pause the automation and wait for a user to come in and interact with it. In this case, it’s going to show us the result of our automation. Here’s our automation in Operations Manager. Let’s kick it off using the form that we built.
Jerry Dollens • 03:14
We’ll take our spreadsheet, upload it to the form, and then we’ll click the Run Manually button. Here we can see our automation as it’s running. We’ve already completed the first three steps, and we’re currently waiting on our child job to allocate our new IP addresses. Our IP addresses have been allocated, and the automation has rendered our user-friendly output with our Jinja template. Let’s go ahead and see what that looks like. Now here we can see the same list of hosts and address pools from our spreadsheet, along with their newly allocated IP addresses. Lastly, let’s take a look at Netbox.
Jerry Dollens • 03:47
Once again, we have the same list of hosts with their newly allocated IP addresses. Thank you for your time today. One last thing before we end. Here at Itential, we offer free hands-on technical workshops, and this is one of the many use cases we offer where you can spend time with someone from our team and try it out yourself. You can check it out at itentl.com slash Automation Workshop. Take a look at all of our use cases and let us know which one you want to try.