Provision VPC and EC2 Instance (AWS) - Transformation
  • 18 Oct 2024
  • Dark
    Light
  • PDF

Provision VPC and EC2 Instance (AWS) - Transformation

  • Dark
    Light
  • PDF

Article summary


create_a_transformation_title

Before we dive into our lab exercise, we will complete an activity related to our JSON Schema Transformation tool, or JST.  Many of the technologies that the platform communicates with do so through APIs and JSON Schema.  Often times, when we reach out to a system to retrieve information, more data is returned than we need, or it is in a format that we need to modify.  Rather than creating a function that would modify the data for us, we can use our low-code data manipulation tool, Transformation, to modify the data so that we can feed it back into our workflow.

For our next activity, let’s create a new Transformation.

Transformation Video

Step 1

From the Itential Automation Platform dashboard, click Automation Studio in the left navigation panel.

Step 2

Click the + icon. The Create window opens.

Step 3

Select Transformation in the What would you like to create dropdown. Type Transformation -  XX in the Name field (XX represents your initials). Click the CREATE button.

Step 4

The canvas loads with a lot of empty space in the center. If you would like to remove extra space from your canvas, you can do so by hovering your cursor near the top of the canvas, and selecting the delete (trash can) icon. You can also add space to your canvas by hovering your cursor near the top of the canvas and selecting the plus icon. To zoom in or our on your canvas, use the canvas controls in the top right corner of the canvas.


Step 5

As you can see, we have Incoming Schemas and Outgoing Schemas. This describes how data will look before and after it is manipulated. Many times, you will receive data from a system and that will define your incoming schema. Our outgoing schema will be what you need the data to look like in order to feed it back into our workflow. Let’s start by creating a few incoming variables.

Step 6

Hover your cursor over the Add + button and select Incoming Schema from the list that appears. 

Step 7

The Add Incoming Schema window opens.

Step 8

Type firstName between the "" on line 2 to add the required ID property.

Step 9

Type string between the double quotes on line 3 to add the required type property. Click the Save button.

Step 10

Repeat the process to add two more Incoming Schema and two Outgoing Schema using the data specified.  When finished, we will take the Incoming variables and make them into Outgoing variables using a series of Methods.

Incoming schema

  • ID: lastName
    • type: string
  • ID: numberOfPets
    • type: number

Outgoing schema

  • ID: email
    • type: string
  • ID: petStatus
    • type: string

Step 11

Transformations offer a number of built-in Methods that will manipulate data to fit the needs of the Outgoing Schema.   These Methods do any number of actions from converting data types to creating conditions for the way the data is manipulated.  We will use a few of these Methods in our exercise today. 

 Type concat in the Search field to find the concat Method.  The list will filter as you type.

Step 12

Drag the concat string method to the canvas. Concatenation is a method used for combining data. In this case, we'll combine first name input, last name input with a domain to create an email address. 

Note: For additional information about a method, click the i icon next to the method name.

Step 13

Click the half-circle to the right of firstName string in the list. Drag a line to the half-circle for the first str parameter in the concat method.

Step 14

Type a . (period) in the str2 field. Connect lastName to the strN property.

Step 15

Type @domain.com in the strN field.

Step 16

Connect the return of the concat method to the email outgoing schema.

Step 17

Add an add (+) method to the canvas. Connect the return of the numberOfPets to the first numN property. Type in the second numN field.

Step 18

Add a greatThan (>) method to the canvas. Connect the return of the add (+) method to the a parameter of the greatThan (>) method. Type 5 in the b parameter field of the greatThan (>) method.

Step 19

Add a ternary method to the canvas. Connect the return of the greaterThan(>) method with the condition field of the ternary method. Connect the return of the ternary method with the petStatus outgoing schema.

Step 20

Type That’s a lot of animals! in the exprIfTrue field. Type You need another pet! in the exprIFalse field. Click the Save icon.

Step 21

Click the  icon.

Step 22

Replace the null values with the following data:

  • firstName: “First”
  • lastName: “Last”
  • numberOfPets: 3

Step 23

Click the Run button.

Step 24

Review the output. 



Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.