Itential vendor logo

Vendor

Itential

Product

IAP

Project Type

Transformation Project


View Repository
Workflow

IAP Data Manipulation Transformations

Overview

This Transformation Project contains several transformation examples that are used for data manipulation in Itential Automation Platform (IAP)

Transformations

NameOverview
Aggregate Functions for Arrays - IAPRun a set of mathematical aggregate functions on an array of numbers
Allocate a Pair of Numbers - IAPFind the first available consecutive pair of numbers from an array of already allocated integers given a starting integer and an ending integer
Allocate One Number - IAPFind the first available number from an array of already allocated integers given a starting integer and an ending integer
Chunk Array - IAPSplit an array into a smaller sized groups given a desired chunk size
Clear Empty Keys - IAPClear empty keys from a JSON
Convert CSV to JSON - IAPConvert CSV into JSON
Convert String to Special Cases - IAPConvert string to special cases including camelCase, PascalCase, kebab-case, and snake_case
Filter Array of Objects by Key Value Pair - IAPFilter array of objects by key value pair
Generate Random Integer Within Range - IAPGenerate a random integer within a range
Get Random Element From Array - IAPGet a random element from array
Get Value From JSON Pointer - IAPGet a value from an object using JSON Pointer
Group Records by Property - IAPGroup records by a property
Implement Set Operations on Arrays - IAPImplement set operations on 2 arrays including union, intersection, set difference and symmetric difference
Parse Number - IAPConvert strings and strings within objects to numbers
Remove Duplicates From Array of Arrays or Objects - IAPRemove duplicates from an array of objects or array of arrays
Remove Duplicates From Array of Primitives - IAPRemove duplicates from an array of primitives
Remove Element From Array by Index - IAPRemove an element from an array by index
Remove Element From Array by Value - IAPRemove an element from an array by a value
Separate Array of Objects by Key Value Pair - IAPSeparate an array of objects by a key value pair
Split String into Array by Regex or Separator - IAPSplit a string into an array by regex or another string
Transpose Record by Creating Arrays for Each Property Within Groups - IAPTranspose the record by creating arrays for each property within the groups

For further technical details on how to install and use this Transformation Project, please click the Technical Documentation tab.

Table of Contents

Getting Started

This section is helpful for deployments as it provides you with pertinent information on prerequisites and properties.

Helpful Background Information

Transformation are used to translate data from one format to a different format.

Prerequisites

Itential Transformation Projects are built and tested on particular versions of IAP. In addition, Transformation Projects are often dependent on external systems and as such, these Transformation Projects will have dependencies on these other systems. This version of IAP - Data Manipulation has been tested with:

  • IAP 2023.2

External Dependencies

No external dependencies required to run this Transformation Project.

Adapters

No adapters required to run this Transformation Project.

How to Install

To install the Transformation Project:

  • Verify you are running a supported version of the Itential Automation Platform (IAP) as listed above in the Supported IAP Versions section in order to install the Transformation Project.
  • Import the Transformation Project in Admin Essentials.

Testing

Cypress is generally used to test all Itential Transformation Projects. While Cypress is an opensource tool, at Itential we have internal libraries that have been built around Cypress to allow us to test with a deployed IAP.

When certifying our Transformation Projects for a release of IAP we run these tests against the particular version of IAP and create a release branch in GitLab. If you do not see the Transformation Project available in your version of IAP please contact Itential.

While Itential tests this Transformation Project and its capabilities, it is often the case the customer environments offer their own unique circumstances. Therefore, it is our recommendation that you deploy this Transformation Project into a development/testing environment in which you can test the Transformation Project.

Using this Transformation Project

Transformation Projects contain 1 or more transformations. Each of these transformations have different inputs and outputs.

Aggregate Functions for Arrays - IAP

Run a set of mathematical aggregate functions on an array of numbers

Capabilities include:

  • The transformation allows IAP users to run a set of mathematical aggregate functions on an array of numbers. The aggregate functions consist of Sum, Product, Maximum, Minimum, Range, Count, Arithmetic Mean, Geometric Mean, Harmonic Mean, Median, Mode, Standard Deviation, and Variance

Entry Point IAP Component

The primary IAP component to run Aggregate Functions for Arrays - IAP is listed below:

IAP Component NameIAP Component Type
Aggregate Functions for Arrays - IAPTransformation

Inputs

The following table lists the inputs for Aggregate Functions for Arrays - IAP:

NameTypeRequiredDescriptionExample Value
groupedArrayarrayyesAn array of numbers
[
  1,
  2,
  3
]

Outputs

The following table lists the outputs for Aggregate Functions for Arrays - IAP:

NameTypeDescriptionExample Value
sumnumberSummation of the items in the array
6
productnumberProduct of the items in the array
6
maximumnumberThe highest value in the array
3
minumumnumberThe lowest value in the array
1
rangenumberDifference between the lowest and highest values
2
countnumberNumber of items used for the calculations
3
arithmeticMeannumberThe sum of all the numbers in the array divided by the count of all numbers in the array
2
geometricMeannumberThe average value which signifies the central tendency of the numbers in the arrays by taking the root of the product of their values
1.8171205928321397
harmonicMeannumberThe reciprocal of the average of the reciprocals
1.6363636363636365
mediannumberMiddle value of the items in the array
2
modearrayThe numbers that appear most often in the array
[
  1,
  2,
  3
]
modeFrequencynumberThe number of times the most frequently occurring numbers appear
1
standardDeviationnumberMeasure of the amount of variation or dispersion of the items in the array
0.82915619758885
variancenumberMeasure of how far the array items are spread out from the arithmetic mean
0.6875
valuesIgnoredarrayItems of the array that were either not a number or a parsable string and were ignored from all calculations
[]
valuesUsedarrayItems of the array that were either a number or a parsable string and were used for all calculations
[
  1,
  2,
  3
]
valuesUsed-convertedarrayThe parsed form of all items in valuesUsed
[
  1,
  2,
  3
]

Query Output

There are no query output examples for Aggregate Functions for Arrays - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "groupedArray": [
    1,
    2,
    3
  ]
} 

Output:

{
  "sum": 6,
  "maximum": 3,
  "minimum": 1,
  "range": 2,
  "count": 3,
  "arithmeticMean": 2,
  "geometricMean": 1.8171205928321397,
  "product": 6,
  "harmonicMean": 1.6363636363636365,
  "median": 2,
  "mode": [
    1,
    2,
    3
  ],
  "modeFrequency": 1,
  "standardDeviation": 0.816496580927726,
  "variance": 0.6666666666666666,
  "valuesIgnored": [],
  "valuesUsed": [
    1,
    2,
    3
  ],
  "valuesUsed-converted": [
    1,
    2,
    3
  ]
} 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Allocate One Number - IAP

Find the first available number from an array of already allocated integers given a starting integer and an ending integer

Capabilities include:

  • This transformation allows IAP users to find the first available number from an array of already allocated integers given a starting integer and an ending integer

Entry Point IAP Component

The primary IAP component to run Allocate One Number - IAP is listed below:

IAP Component NameIAP Component Type
Allocate One Number - IAPTransformation

Inputs

The following table lists the inputs for Allocate One Number - IAP:

NameTypeRequiredDescriptionExample Value
allocatedarrayyesArray of already allocated integers
[
  1,
  4,
  5
]
startRangeintegeryesLower bound (inclusive) for the range between which a number is allocated
5
endRangeintegeryesUpper bound (exclusive) for the range between which a number is allocated
8

Outputs

The following table lists the outputs for Allocate One Number - IAP:

NameTypeDescriptionExample Value
assigned['integer', 'boolean']The first available number if found. Otherwise, it will be false
6

Query Output

There are no query output examples for Allocate One Number - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "allocated": [
    1,
    4,
    5
  ],
  "startRange": 5,
  "endRange": 8
} 

Output:

{
  "assigned": 6
} 
Example 2

Input:

{
  "allocated": [
    1
  ],
  "startRange": 2,
  "endRange": 2
} 

Output:

{
  "assigned": false
} 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Allocate a Pair of Numbers - IAP

Find the first available consecutive pair of numbers from an array of already allocated integers given a starting integer and an ending integer

Capabilities include:

  • This transformation allows IAP users to find the first available consecutive pair of numbers from an array of already allocated integers given a starting integer and an ending integer

Entry Point IAP Component

The primary IAP component to run Allocate a Pair of Numbers - IAP is listed below:

IAP Component NameIAP Component Type
Allocate a Pair of Numbers - IAPTransformation

Inputs

The following table lists the inputs for Allocate a Pair of Numbers - IAP:

NameTypeRequiredDescriptionExample Value
allocatedarrayyesArray of already allocated integers
[
  1,
  4,
  5
]
startRangeintegeryesLower bound (inclusive) for the range between which a pair of numbers is allocated
5
endRangeintegeryesUpper bound (inclusive) for the range between which a pair of numbers is allocated
8

Outputs

The following table lists the outputs for Allocate a Pair of Numbers - IAP:

NameTypeDescriptionExample Value
assigned['array', 'boolean']An array of the first availble consecutive pair if found. Otherwise, it will be false
[
  6,
  7
]

Query Output

There are no query output examples for Allocate a Pair of Numbers - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "allocated": [
    1,
    4,
    5
  ],
  "startRange": 5,
  "endRange": 8
} 

Output:

{
  "assigned": [
    6,
    7
  ]
} 
Example 2

Input:

{
  "allocated": [
    1,
    4,
    5,
    7
  ],
  "startRange": 5,
  "endRange": 8
} 

Output:

{
  "assigned": false
} 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Chunk Array - IAP

Split an array into a smaller sized groups given a desired chunk size

Capabilities include:

  • This transformation allows IAP users to split an array into a smaller sized groups given a desired chunk size

Entry Point IAP Component

The primary IAP component to run Chunk Array - IAP is listed below:

IAP Component NameIAP Component Type
Chunk Array - IAPTransformation

Inputs

The following table lists the inputs for Chunk Array - IAP:

NameTypeRequiredDescriptionExample Value
originalArrayarrayyesAn array that needs to be splitted in chunks
[
  1,
  2,
  3,
  "a",
  "b"
]
chunkSizenumberyesThe size of each chunk when splitting an array
3

Outputs

The following table lists the outputs for Chunk Array - IAP:

NameTypeDescriptionExample Value
splitArrayarrayThe array that has been splitted in chunks
[
  [
    1,
    2,
    3
  ],
  [
    "a",
    "b"
  ]
]

Query Output

There are no query output examples for Chunk Array - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "originalArray": [
    1,
    2,
    3,
    "a",
    "b"
  ],
  "chunkSize": 3
} 

Output:

[
  [
    1,
    2,
    3
  ],
  [
    "a",
    "b"
  ]
] 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Clear Empty Keys - IAP

Clear empty keys from a JSON

Capabilities include:

  • This transformation allows IAP users to clear empty keys from a JSON input. Empty keys consist of empty objects, empty arrays, empty strings, and null values

Entry Point IAP Component

The primary IAP component to run Clear Empty Keys - IAP is listed below:

IAP Component NameIAP Component Type
Clear Empty Keys - IAPTransformation

Inputs

The following table lists the inputs for Clear Empty Keys - IAP:

NameTypeRequiredDescriptionExample Value
inputobjectyesAn object that needs to be cleaned
{
  "name": "John",
  "age": "30",
  "address": {},
  "hobbies": []
}

Outputs

The following table lists the outputs for Clear Empty Keys - IAP:

NameTypeDescriptionExample Value
outputobjectClean object without empty keys
{
  "name": "John",
  "age": "30"
}

Query Output

There are no query output examples for Clear Empty Keys - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "input": {
    "name": "John",
    "age": "30",
    "address": {},
    "hobbies": []
  }
} 

Output:

{
  "name": "John",
  "age": "30"
} 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Convert CSV to JSON - IAP

Convert CSV into JSON

Capabilities include:

  • This transformation allows IAP users to convert a CSV into a JSON

Entry Point IAP Component

The primary IAP component to run Convert CSV to JSON - IAP is listed below:

IAP Component NameIAP Component Type
Convert CSV to JSON - IAPTransformation

Inputs

The following table lists the inputs for Convert CSV to JSON - IAP:

NameTypeRequiredDescriptionExample Value
csvstringyesCSV to convert to JSON
a,b,c,d,e,f
1,2,3,4,5,7,8,9,0
5,4,3,2,1
1,2,3,4,5

Outputs

The following table lists the outputs for Convert CSV to JSON - IAP:

NameTypeDescriptionExample Value
jsonarrayJSON format of the CSV
[
  {
    "a": "1",
    "b": "2",
    "c": "3",
    "d": "4",
    "e": "5",
    "f": "7"
  },
  {
    "a": "5",
    "b": "4",
    "c": "3",
    "d": "2",
    "e": "1",
    "f": ""
  },
  {
    "a": "1",
    "b": "2",
    "c": "3",
    "d": "4",
    "e": "5",
    "f": ""
  }
]

Query Output

There are no query output examples for Convert CSV to JSON - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "csv": "a,b,c,d,e,f\n1,2,3,4,5,7,8,9,0\n5,4,3,2,1\n1,2,3,4,5"
} 

Output:

[
  {
    "a": "1",
    "b": "2",
    "c": "3",
    "d": "4",
    "e": "5",
    "f": "7"
  },
  {
    "a": "5",
    "b": "4",
    "c": "3",
    "d": "2",
    "e": "1",
    "f": ""
  },
  {
    "a": "1",
    "b": "2",
    "c": "3",
    "d": "4",
    "e": "5",
    "f": ""
  }
] 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Convert String to Special Cases - IAP

Convert string to special cases including camelCase, PascalCase, kebab-case, and snake_case

Capabilities include:

  • This transformation allows IAP users to convert a string separated by whitespace to camelCase, PascalCase, kebab-case, and snake_case

Entry Point IAP Component

The primary IAP component to run Convert String to Special Cases - IAP is listed below:

IAP Component NameIAP Component Type
Convert String to Special Cases - IAPTransformation

Inputs

The following table lists the inputs for Convert String to Special Cases - IAP:

NameTypeRequiredDescriptionExample Value
incomingStringstringyesA string separated by whitespace
foo bar foobar

Outputs

The following table lists the outputs for Convert String to Special Cases - IAP:

NameTypeDescriptionExample Value
toCamelCasestringCamel case which has no interventing spaces or underscores, and all words except the first one starting with a capital letter
fooBarFoobar
toSnakeCasestringSnake case which has spaces replaced by underscores
foo_bar_foobar
toKebabCasestringKebab case which has spaces replaced by hyphens
foo-bar-foobar
toPascalCasestringPascal case which has all words starting with a capital letter
FooBarFoobar

Query Output

There are no query output examples for Convert String to Special Cases - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "incomingString": "foo bar foobar"
} 

Output:

{
  "toCamelCase": "fooBarFoobar",
  "toSnakeCase": "foo_bar_foobar",
  "toKebabCase": "foo-bar-foobar",
  "toPascalCase": "FooBarFoobar"
} 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Filter Array of Objects by Key Value Pair - IAP

Filter array of objects by key value pair

Capabilities include:

  • This transformation allows IAP users to filter an array of objects by providing a key and a value to match on, and the option to discard the matching items from the array

Entry Point IAP Component

The primary IAP component to run Filter Array of Objects by Key Value Pair - IAP is listed below:

IAP Component NameIAP Component Type
Filter Array of Objects by Key Value Pair - IAPTransformation

Inputs

The following table lists the inputs for Filter Array of Objects by Key Value Pair - IAP:

NameTypeRequiredDescriptionExample Value
filterableArrayarrayyesAn array of objects
[
  {
    "city": "Atlanta",
    "state": "GA"
  },
  {
    "city": "Sandy Springs",
    "state": "GA"
  },
  {
    "city": "Dallas",
    "state": "TX"
  },
  {
    "city": "Orlando",
    "state": "FL"
  }
]
keyToFilterOnstringyesKey to match on
state
valueToFind['string', 'number', 'boolean', 'array', 'object', 'null']yesValue of the key to match on
GA
discardMatchingbooleanyesWhether to remove matching items from the array or not
true

Outputs

The following table lists the outputs for Filter Array of Objects by Key Value Pair - IAP:

NameTypeDescriptionExample Value
filteredArrayarrayEither an array of matching items if discardMatching is set to false, or an array of unmatching items if discardMatching is set to true
[
  {
    "city": "Dallas",
    "state": "TX"
  },
  {
    "city": "Orlando",
    "state": "FL"
  }
]
firstFilteredElementobjectFirst item in the filtered array
{
  "city": "Dallas",
  "state": "TX"
}

Query Output

There are no query output examples for Filter Array of Objects by Key Value Pair - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "filterableArray": [
    {
      "city": "Atlanta",
      "state": "GA"
    },
    {
      "city": "Sandy Springs",
      "state": "GA"
    },
    {
      "city": "Dallas",
      "state": "TX"
    },
    {
      "city": "Orlando",
      "state": "FL"
    }
  ],
  "keyToFilterOn": "state",
  "valueToFind": "GA",
  "discardMatching": true
} 

Output:

{
  "filteredArray": [
    {
      "city": "Dallas",
      "state": "TX"
    },
    {
      "city": "Orlando",
      "state": "FL"
    }
  ],
  "firstFilteredElement": {
    "city": "Dallas",
    "state": "TX"
  }
} 
Example 2

Input:

{
  "filterableArray": [
    {
      "city": "Atlanta",
      "state": "GA"
    },
    {
      "city": "Sandy Springs",
      "state": "GA"
    },
    {
      "city": "Dallas",
      "state": "TX"
    },
    {
      "city": "Orlando",
      "state": "FL"
    }
  ],
  "keyToFilterOn": "state",
  "valueToFind": "GA",
  "discardMatching": false
} 

Output:

{
  "filteredArray": [
    {
      "city": "Atlanta",
      "state": "GA"
    },
    {
      "city": "Sandy Springs",
      "state": "GA"
    }
  ],
  "firstFilteredElement": {
    "city": "Atlanta",
    "state": "GA"
  }
} 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Generate Random Integer Within Range - IAP

Generate a random integer within a range

Capabilities include:

  • This transformation allows IAP users to generate a random integer within a provided range (inclusive of both min and max)

Entry Point IAP Component

The primary IAP component to run Generate Random Integer Within Range - IAP is listed below:

IAP Component NameIAP Component Type
Generate Random Integer Within Range - IAPTransformation

Inputs

The following table lists the inputs for Generate Random Integer Within Range - IAP:

NameTypeRequiredDescriptionExample Value
minimumintegeryesLower bound (inclusive) for the range between which a random integer will be generated
2
maximumintegeryesUpper bound (inclusive) for the range between which a random integer will be generated
5

Outputs

The following table lists the outputs for Generate Random Integer Within Range - IAP:

NameTypeDescriptionExample Value
randomIntegerintegerRandomly generated integer
2

Query Output

There are no query output examples for Generate Random Integer Within Range - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "minimum": 2,
  "maximum": 5
} 

Output:

2 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Get Random Element From Array - IAP

Get a random element from array

Capabilities include:

  • This transformation allows IAP users to get a random element from an array

Entry Point IAP Component

The primary IAP component to run Get Random Element From Array - IAP is listed below:

IAP Component NameIAP Component Type
Get Random Element From Array - IAPTransformation

Inputs

The following table lists the inputs for Get Random Element From Array - IAP:

NameTypeRequiredDescriptionExample Value
arrayarrayyesArray from which a random element has to be selected
[
  {
    "city": "Atlanta",
    "state": "GA"
  },
  {
    "city": "Sandy Springs",
    "state": "GA"
  },
  {
    "city": "Dallas",
    "state": "TX"
  },
  {
    "city": "Orlando",
    "state": "FL"
  }
]

Outputs

The following table lists the outputs for Get Random Element From Array - IAP:

NameTypeDescriptionExample Value
arrayWithoutElementarrayArray without the randomly selected element
[
  {
    "city": "Sandy Springs",
    "state": "GA"
  },
  {
    "city": "Dallas",
    "state": "TX"
  },
  {
    "city": "Orlando",
    "state": "FL"
  }
]
randomElement['number', 'string', 'boolean', 'array', 'object', 'null']Randomly selected element
{
  "city": "Atlanta",
  "state": "GA"
}
randomElementIndexintegerIndex of the randomly selected element
0
poppedArrayLengthintegerLength of the array without the randomly selected element
3

Query Output

There are no query output examples for Get Random Element From Array - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "array": [
    {
      "city": "Atlanta",
      "state": "GA"
    },
    {
      "city": "Sandy Springs",
      "state": "GA"
    },
    {
      "city": "Dallas",
      "state": "TX"
    },
    {
      "city": "Orlando",
      "state": "FL"
    }
  ]
} 

Output:

{
  "arrayWithoutElement": [
    {
      "city": "Sandy Springs",
      "state": "GA"
    },
    {
      "city": "Dallas",
      "state": "TX"
    },
    {
      "city": "Orlando",
      "state": "FL"
    }
  ],
  "randomElement": {
    "city": "Atlanta",
    "state": "GA"
  },
  "randomElementIndex": 0,
  "poppedArrayLength": 3
} 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Get Value From JSON Pointer - IAP

Get a value from an object using JSON Pointer

Capabilities include:

  • This transformation allows IAP users to get a value from an object based on the JSON Pointer

Entry Point IAP Component

The primary IAP component to run Get Value From JSON Pointer - IAP is listed below:

IAP Component NameIAP Component Type
Get Value From JSON Pointer - IAPTransformation

Inputs

The following table lists the inputs for Get Value From JSON Pointer - IAP:

NameTypeRequiredDescriptionExample Value
jsonPointerstringyesA string that provides a reference to a specific value within a JSON document
/a/b
objobjectyesObject to get value from
{
  "a": {
    "b": 2,
    "c": 3
  }
}

Outputs

The following table lists the outputs for Get Value From JSON Pointer - IAP:

NameTypeDescriptionExample Value
valuearray, boolean, string, number, object, nullThe value obtained using JSON pointer
2

Query Output

There are no query output examples for Get Value From JSON Pointer - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "jsonPointer": "/a/b",
  "obj": {
    "a": {
      "b": 2,
      "c": 3
    }
  }
} 

Output:

2 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Group Records by Property - IAP

Group records by a property

Capabilities include:

  • This transformation allows IAP users to group records by a specific property

Entry Point IAP Component

The primary IAP component to run Group Records by Property - IAP is listed below:

IAP Component NameIAP Component Type
Group Records by Property - IAPTransformation

Inputs

The following table lists the inputs for Group Records by Property - IAP:

NameTypeRequiredDescriptionExample Value
arrayarrayyesAn array of objects
[
  {
    "fruit": "apple",
    "price": "42.2",
    "type": "fruit"
  },
  {
    "fruit": "banana",
    "price": "10.1",
    "type": "fruit"
  },
  {
    "fruit": "potato",
    "price": "20",
    "type": "vegetable"
  }
]
groupByPropertystringyesProperty used to group the records
type

Outputs

The following table lists the outputs for Group Records by Property - IAP:

NameTypeDescriptionExample Value
outputobjectThe grouped data object where the keys are unique values of the desired property, and the values are arrays containing records with the same property value
{
  "fruit": [
    {
      "fruit": "apple",
      "price": "42.2",
      "type": "fruit"
    },
    {
      "fruit": "banana",
      "price": "10.1",
      "type": "fruit"
    }
  ],
  "vegetable": [
    {
      "fruit": "potato",
      "price": "20",
      "type": "vegetable"
    }
  ]
}

Query Output

There are no query output examples for Group Records by Property - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "array": [
    {
      "fruit": "apple",
      "price": "42.2",
      "type": "fruit"
    },
    {
      "fruit": "banana",
      "price": "10.1",
      "type": "fruit"
    },
    {
      "fruit": "potato",
      "price": "20",
      "type": "vegetable"
    }
  ],
  "groupByProperty": "type"
} 

Output:

{
  "fruit": [
    {
      "fruit": "apple",
      "price": "42.2",
      "type": "fruit"
    },
    {
      "fruit": "banana",
      "price": "10.1",
      "type": "fruit"
    }
  ],
  "vegetable": [
    {
      "fruit": "potato",
      "price": "20",
      "type": "vegetable"
    }
  ]
} 
Example 2

Input:

{
  "array": [
    {
      "number": 43,
      "president": "George W. Bush",
      "took_office": "2001-01-20",
      "left_office": "2009-01-20",
      "party": "Republican"
    },
    {
      "number": 44,
      "president": "Barack Obama",
      "took_office": "2009-01-20",
      "left_office": "2017-01-20",
      "party": "Democratic"
    },
    {
      "number": 45,
      "president": "Donald J. Trump",
      "took_office": "2017-01-20",
      "left_office": null,
      "party": "Republican"
    }
  ],
  "groupByProperty": "party"
} 

Output:

{
  "Republican": [
    {
      "number": 43,
      "president": "George W. Bush",
      "took_office": "2001-01-20",
      "left_office": "2009-01-20",
      "party": "Republican"
    },
    {
      "number": 45,
      "president": "Donald J. Trump",
      "took_office": "2017-01-20",
      "left_office": null,
      "party": "Republican"
    }
  ],
  "Democratic": [
    {
      "number": 44,
      "president": "Barack Obama",
      "took_office": "2009-01-20",
      "left_office": "2017-01-20",
      "party": "Democratic"
    }
  ]
} 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Implement Set Operations on Arrays - IAP

Implement set operations on 2 arrays including union, intersection, set difference and symmetric difference

Capabilities include:

  • This transformation allows IAP users to implement set operations on 2 arrays including union, intersection, set difference and symmetric difference

Entry Point IAP Component

The primary IAP component to run Implement Set Operations on Arrays - IAP is listed below:

IAP Component NameIAP Component Type
Implement Set Operations on Arrays - IAPTransformation

Inputs

The following table lists the inputs for Implement Set Operations on Arrays - IAP:

NameTypeRequiredDescriptionExample Value
array1arrayyesThe first array which can contain elements of type arrays, numbers, integers, strings, or objects
[
  [
    1,
    3,
    4
  ],
  [
    1,
    3,
    4
  ],
  [
    1,
    2
  ],
  "apple"
]
array2arrayyesThe second array which can contain elements of type arrays, numbers, integers, strings, or objects
[
  [
    1,
    3,
    4
  ],
  [
    1,
    3,
    5
  ],
  "apple",
  99
]

Outputs

The following table lists the outputs for Implement Set Operations on Arrays - IAP:

NameTypeDescriptionExample Value
intersectionarrayArray containing elements common to both arrays
[
  [
    1,
    3,
    4
  ],
  "apple"
]
array1OnlyarrayArray containing elements in "array1" but not in "array2"
[
  [
    1,
    2
  ]
]
array2OnlyarrayArray containing elements in "array2" but not in "array1"
[
  [
    1,
    3,
    5
  ],
  99
]
differencearrayArray containing elements that are present in either "array1" or "array2", but not in both
[
  [
    1,
    2
  ],
  [
    1,
    3,
    5
  ],
  99
]
unionarrayArray containing all unique elements from both arrays
[
  [
    1,
    3,
    4
  ],
  [
    1,
    2
  ],
  "apple",
  [
    1,
    3,
    5
  ],
  99
]

Query Output

There are no query output examples for Implement Set Operations on Arrays - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "array1": [
    [
      1,
      3,
      4
    ],
    [
      1,
      3,
      4
    ],
    [
      1,
      2
    ],
    "apple"
  ],
  "array2": [
    [
      1,
      3,
      4
    ],
    [
      1,
      3,
      5
    ],
    "apple",
    99
  ]
} 

Output:

{
  "intersection": [
    [
      1,
      3,
      4
    ],
    "apple"
  ],
  "array1Only": [
    [
      1,
      2
    ]
  ],
  "array2Only": [
    [
      1,
      3,
      5
    ],
    99
  ],
  "difference": [
    [
      1,
      2
    ],
    [
      1,
      3,
      5
    ],
    99
  ],
  "union": [
    [
      1,
      3,
      4
    ],
    [
      1,
      2
    ],
    "apple",
    [
      1,
      3,
      5
    ],
    99
  ]
} 
Example 2

Input:

{
  "array1": [
    {
      "city": "Atlanta",
      "state": "GA"
    },
    {
      "city": "Sandy Springs",
      "state": "GA"
    },
    {
      "city": "Dallas",
      "state": "TX"
    },
    {
      "city": "Silver Spring",
      "state": "MD"
    }
  ],
  "array2": [
    {
      "city": "Atlanta",
      "state": "GA"
    },
    {
      "city": "Sandy Springs",
      "state": "GA"
    },
    {
      "city": "Dallas",
      "state": "TX"
    },
    {
      "city": "Orlando",
      "state": "FL"
    }
  ]
} 

Output:

{
  "intersection": [
    {
      "city": "Atlanta",
      "state": "GA"
    },
    {
      "city": "Sandy Springs",
      "state": "GA"
    },
    {
      "city": "Dallas",
      "state": "TX"
    }
  ],
  "array1Only": [
    {
      "city": "Silver Spring",
      "state": "MD"
    }
  ],
  "array2Only": [
    {
      "city": "Orlando",
      "state": "FL"
    }
  ],
  "difference": [
    {
      "city": "Silver Spring",
      "state": "MD"
    },
    {
      "city": "Orlando",
      "state": "FL"
    }
  ],
  "union": [
    {
      "city": "Atlanta",
      "state": "GA"
    },
    {
      "city": "Sandy Springs",
      "state": "GA"
    },
    {
      "city": "Dallas",
      "state": "TX"
    },
    {
      "city": "Silver Spring",
      "state": "MD"
    },
    {
      "city": "Orlando",
      "state": "FL"
    }
  ]
} 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Parse Number - IAP

Convert strings and strings within objects to numbers

Capabilities include:

  • This transformation allows IAP users to convert strings and strings within objects to numbers

Entry Point IAP Component

The primary IAP component to run Parse Number - IAP is listed below:

IAP Component NameIAP Component Type
Parse Number - IAPTransformation

Inputs

The following table lists the inputs for Parse Number - IAP:

NameTypeRequiredDescriptionExample Value
keysToConvertarrayyesThe keys to be converted in the object if the data is an object or an array of objects. Set this attribute to [] if not applicable, or if all keys need to be converted
[
  "price",
  "aisle"
]
data['array', 'number', 'string', 'object']yesData that have strings that need to be converted to number. For arrays and objects, the JST will convert strings in the first level only
{
  "fruit": "apple",
  "quantity": "30",
  "price": "42.2",
  "aisle": "23b"
}

Outputs

The following table lists the outputs for Parse Number - IAP:

NameTypeDescriptionExample Value
output['array', 'object', 'number', 'string']Parsed data
{
  "fruit": "apple",
  "quantity": "30",
  "price": 42.2,
  "aisle": "23b"
}

Query Output

There are no query output examples for Parse Number - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "keysToConvert": [
    "price",
    "aisle"
  ],
  "data": {
    "fruit": "apple",
    "quantity": "30",
    "price": "42.2",
    "aisle": "23b"
  }
} 

Output:

{
  "fruit": "apple",
  "quantity": "30",
  "price": 42.2,
  "aisle": "23b"
} 
Example 2

Input:

{
  "keysToConvert": [],
  "data": [
    12,
    true,
    "32.23",
    "banana",
    [
      "43"
    ],
    "35"
  ]
} 

Output:

[
  12,
  true,
  32.23,
  "banana",
  [
    "43"
  ],
  35
] 
Example 3

Input:

{
  "keysToConvert": [],
  "data": [
    {
      "FILE_SYSTEM": "net/node0_RP0_CPU0/harddisk",
      "TOTAL_SIZE": "17538482176",
      "TOTAL_FREE": "14333425152"
    },
    {
      "FILE_SYSTEM": "net/node0_RP1_CPU0/harddisk",
      "TOTAL_SIZE": "17538482175",
      "TOTAL_FREE": "44222222"
    }
  ]
} 

Output:

[
  {
    "FILE_SYSTEM": "net/node0_RP0_CPU0/harddisk",
    "TOTAL_SIZE": 17538482176,
    "TOTAL_FREE": 14333425152
  },
  {
    "FILE_SYSTEM": "net/node0_RP1_CPU0/harddisk",
    "TOTAL_SIZE": 17538482175,
    "TOTAL_FREE": 44222222
  }
] 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Remove Duplicates From Array of Arrays or Objects - IAP

Remove duplicates from an array of objects or array of arrays

Capabilities include:

  • This transformation allows IAP users to remove duplicates from an array of objects or array of arrays

Entry Point IAP Component

The primary IAP component to run Remove Duplicates From Array of Arrays or Objects - IAP is listed below:

IAP Component NameIAP Component Type
Remove Duplicates From Array of Arrays or Objects - IAPTransformation

Inputs

The following table lists the inputs for Remove Duplicates From Array of Arrays or Objects - IAP:

NameTypeRequiredDescriptionExample Value
arrayarrayyesAn array of objects or an array of arrays
[
  {
    "a": "a"
  },
  {
    "a": "b"
  },
  {
    "a": "a"
  },
  {
    "a": {
      "a": [
        1,
        2,
        3
      ]
    }
  },
  {
    "a": {
      "a": [
        1,
        2,
        3
      ]
    }
  }
]

Outputs

The following table lists the outputs for Remove Duplicates From Array of Arrays or Objects - IAP:

NameTypeDescriptionExample Value
uniqueArrayarrayArray containing the elements from the input array without any duplicates
[
  {
    "a": "a"
  },
  {
    "a": "b"
  },
  {
    "a": {
      "a": [
        1,
        2,
        3
      ]
    }
  }
]

Query Output

There are no query output examples for Remove Duplicates From Array of Arrays or Objects - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "array": [
    {
      "a": "a"
    },
    {
      "a": "b"
    },
    {
      "a": "a"
    },
    {
      "a": {
        "a": [
          1,
          2,
          3
        ]
      }
    },
    {
      "a": {
        "a": [
          1,
          2,
          3
        ]
      }
    }
  ]
} 

Output:

[
  {
    "a": "a"
  },
  {
    "a": "b"
  },
  {
    "a": {
      "a": [
        1,
        2,
        3
      ]
    }
  }
] 
Example 2

Input:

{
  "array": [
    [
      [
        1
      ],
      [
        1
      ],
      [
        2
      ]
    ],
    [
      1,
      2
    ],
    [
      2,
      1
    ],
    [
      3,
      4,
      5
    ],
    [
      1,
      2
    ],
    [
      [
        1
      ],
      [
        1
      ],
      [
        2
      ]
    ],
    [
      [
        1
      ],
      [
        1
      ],
      [
        1
      ]
    ]
  ]
} 

Output:

[
  [
    [
      1
    ],
    [
      1
    ],
    [
      2
    ]
  ],
  [
    1,
    2
  ],
  [
    2,
    1
  ],
  [
    3,
    4,
    5
  ],
  [
    [
      1
    ],
    [
      1
    ],
    [
      1
    ]
  ]
] 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Remove Duplicates From Array of Primitives - IAP

Remove duplicates from an array of primitives

Capabilities include:

  • This transformation allows IAP users to remove duplicates from an array of primitives

Entry Point IAP Component

The primary IAP component to run Remove Duplicates From Array of Primitives - IAP is listed below:

IAP Component NameIAP Component Type
Remove Duplicates From Array of Primitives - IAPTransformation

Inputs

The following table lists the inputs for Remove Duplicates From Array of Primitives - IAP:

NameTypeRequiredDescriptionExample Value
arrayarrayyesArray of primitives to remove duplicates from. An array can hold elements of various data types, including numbers, strings, boolean, null
[
  "hello",
  "world",
  "hello",
  null,
  true,
  true,
  null,
  "world",
  "HeLLo"
]

Outputs

The following table lists the outputs for Remove Duplicates From Array of Primitives - IAP:

NameTypeDescriptionExample Value
uniqueArrayarrayArray containing the elements from the input array without any duplicates
[
  "hello",
  "world",
  null,
  true,
  "HeLLo"
]

Query Output

There are no query output examples for Remove Duplicates From Array of Primitives - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "array": [
    "hello",
    "world",
    "hello",
    null,
    true,
    true,
    null,
    "world",
    "HeLLo"
  ]
} 

Output:

[
  "hello",
  "world",
  null,
  true,
  "HeLLo"
] 
Example 2

Input:

{
  "array": [
    9,
    8,
    7.45,
    77,
    7,
    7,
    8,
    9
  ]
} 

Output:

[
  9,
  8,
  7.45,
  77,
  7
] 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Remove Element From Array by Index - IAP

Remove an element from an array by index

Capabilities include:

  • This transformation allows IAP users to remove an element from an array by index

Entry Point IAP Component

The primary IAP component to run Remove Element From Array by Index - IAP is listed below:

IAP Component NameIAP Component Type
Remove Element From Array by Index - IAPTransformation

Inputs

The following table lists the inputs for Remove Element From Array by Index - IAP:

NameTypeRequiredDescriptionExample Value
arrayarrayyesArray that has element to be removed
[
  9,
  8,
  7.45,
  77,
  7
]
indexintegeryesIndex of the element to be removed
1

Outputs

The following table lists the outputs for Remove Element From Array by Index - IAP:

NameTypeDescriptionExample Value
newArrayarrayModified array after removing an element at the specified index
[
  9,
  7.45,
  77,
  7
]
item['array', 'boolean', 'number', 'string', 'object', 'null']The item that was removed from the array
8

Query Output

There are no query output examples for Remove Element From Array by Index - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "array": [
    9,
    8,
    7.45,
    77,
    7
  ],
  "index": 1
} 

Output:

{
  "newArray": [
    9,
    7.45,
    77,
    7
  ],
  "item": 8
} 
Example 2

Input:

{
  "array": [
    {
      "a": "a"
    },
    {
      "b": "b"
    },
    {
      "c": "a"
    },
    {
      "d": {
        "e": [
          1,
          2
        ]
      }
    },
    {
      "f": {
        "g": [
          1,
          2,
          3
        ]
      }
    }
  ],
  "index": 4
} 

Output:

{
  "newArray": [
    {
      "a": "a"
    },
    {
      "b": "b"
    },
    {
      "c": "a"
    },
    {
      "d": {
        "e": [
          1,
          2
        ]
      }
    }
  ],
  "item": {
    "f": {
      "g": [
        1,
        2,
        3
      ]
    }
  }
} 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Remove Element From Array by Value - IAP

Remove an element from an array by a value

Capabilities include:

  • This transformation allows IAP users to remove an element from an array based on a certain value

Entry Point IAP Component

The primary IAP component to run Remove Element From Array by Value - IAP is listed below:

IAP Component NameIAP Component Type
Remove Element From Array by Value - IAPTransformation

Inputs

The following table lists the inputs for Remove Element From Array by Value - IAP:

NameTypeRequiredDescriptionExample Value
arrayarrayyesArray consisting of numbers, strings, booleans or null
[
  7,
  9,
  8,
  7.45,
  77,
  7
]
value['number', 'string', 'null', 'boolean']yesThe value to be removed from the array
7
removeAllbooleanyesWhether to remove only the first occurrence of the value or all the occurrences. A 'true' value results in the removal of all the occurrences of the value whereas a 'false' value results in the removal of that value at the first found index
true

Outputs

The following table lists the outputs for Remove Element From Array by Value - IAP:

NameTypeDescriptionExample Value
newArrayarrayModified array after removing elements
[
  9,
  8,
  7.45,
  77
]
noOfRemovedItemsbooleanThe number of the items that have been removed
2

Query Output

There are no query output examples for Remove Element From Array by Value - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "array": [
    7,
    9,
    8,
    7.45,
    77,
    7
  ],
  "value": 7,
  "removeAll": true
} 

Output:

{
  "newArray": [
    9,
    8,
    7.45,
    77
  ],
  "noOfRemovedItems": 2
} 
Example 2

Input:

{
  "array": [
    7,
    9,
    8,
    7.45,
    77,
    7
  ],
  "value": 7,
  "removeAll": false
} 

Output:

{
  "newArray": [
    9,
    8,
    7.45,
    77,
    7
  ],
  "noOfRemovedItems": 1
} 
Example 3

Input:

{
  "array": [
    7,
    9,
    8,
    "hi"
  ],
  "value": "hello",
  "removeAll": false
} 

Output:

{
  "newArray": [
    7,
    9,
    8,
    "hi"
  ],
  "noOfRemovedItems": 0
} 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Separate Array of Objects by Key Value Pair - IAP

Separate an array of objects by a key value pair

Capabilities include:

  • This transformation allows IAP users to separate an array of objects into an array of matching items and an array of non-matching items by providing a key and value that needs to be matched

Entry Point IAP Component

The primary IAP component to run Separate Array of Objects by Key Value Pair - IAP is listed below:

IAP Component NameIAP Component Type
Separate Array of Objects by Key Value Pair - IAPTransformation

Inputs

The following table lists the inputs for Separate Array of Objects by Key Value Pair - IAP:

NameTypeRequiredDescriptionExample Value
dataArrayarrayyesAn array of objects that needs separation
[
  {
    "city": "Atlanta",
    "state": "GA"
  },
  {
    "city": "Sandy Springs",
    "state": "GA"
  },
  {
    "city": "Dallas",
    "state": "TX"
  },
  {
    "city": "Orlando",
    "state": "FL"
  }
]
keystringyesThe property that needs to be matched
state
value['array', 'boolean', 'null', 'object', 'number', 'string']yesThe value of the property that needs to be matched
GA

Outputs

The following table lists the outputs for Separate Array of Objects by Key Value Pair - IAP:

NameTypeDescriptionExample Value
matchingItemsarrayArray of the matching objects
[
  {
    "city": "Atlanta",
    "state": "GA"
  },
  {
    "city": "Sandy Springs",
    "state": "GA"
  }
]
nonmatchingItemsarrayArray of the non-matching objects
[
  {
    "city": "Dallas",
    "state": "TX"
  },
  {
    "city": "Orlando",
    "state": "FL"
  }
]

Query Output

There are no query output examples for Separate Array of Objects by Key Value Pair - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "dataArray": [
    {
      "city": "Atlanta",
      "state": "GA"
    },
    {
      "city": "Sandy Springs",
      "state": "GA"
    },
    {
      "city": "Dallas",
      "state": "TX"
    },
    {
      "city": "Orlando",
      "state": "FL"
    }
  ],
  "key": "state",
  "value": "GA"
} 

Output:

{
  "matchingItems": [
    {
      "city": "Atlanta",
      "state": "GA"
    },
    {
      "city": "Sandy Springs",
      "state": "GA"
    }
  ],
  "nonmatchingItems": [
    {
      "city": "Dallas",
      "state": "TX"
    },
    {
      "city": "Orlando",
      "state": "FL"
    }
  ]
} 
Example 2

Input:

{
  "dataArray": [
    {
      "store": "Costco",
      "item": "orange"
    },
    {
      "store": "Costco",
      "item": "milk"
    },
    {
      "store": "Kroger",
      "item": "yam"
    },
    {
      "store": "CVS",
      "item": "batteries"
    }
  ],
  "key": "store",
  "value": "Walmart"
} 

Output:

{
  "matchingItems": [],
  "nonmatchingItems": [
    {
      "store": "Costco",
      "item": "orange"
    },
    {
      "store": "Costco",
      "item": "milk"
    },
    {
      "store": "Kroger",
      "item": "yam"
    },
    {
      "store": "CVS",
      "item": "batteries"
    }
  ]
} 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Split String into Array by Regex or Separator - IAP

Split a string into an array by regex or another string

Capabilities include:

  • This transformation allows IAP users to split a string into an array by regex or another string

Entry Point IAP Component

The primary IAP component to run Split String into Array by Regex or Separator - IAP is listed below:

IAP Component NameIAP Component Type
Split String into Array by Regex or Separator - IAPTransformation

Inputs

The following table lists the inputs for Split String into Array by Regex or Separator - IAP:

NameTypeRequiredDescriptionExample Value
inputStringstringyesString to be splitted into array
Hello123world-456,2024
separatorStringstringyesString used as a separator. If "separatorString" and "separatorRegex" are included, "separatorString" is used by default and the "separatorRegex" is ignored
o
separatorRegexstringyesRegex pattern used as a separator. If "separatorString" and "separatorRegex" are included, "separatorString" is used by default and the "separatorRegex" is ignored
/\d+/gm
limit['integer', 'null']noA non-negative integer specifying a limit on the number of substrings to be included in the array
2

Outputs

The following table lists the outputs for Split String into Array by Regex or Separator - IAP:

NameTypeDescriptionExample Value
splitArrayarrayArray of substrings
[
  "Hello",
  "world-",
  ",",
  ""
]

Query Output

There are no query output examples for Split String into Array by Regex or Separator - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "inputString": "Hello123world-456,2024",
  "separatorString": "",
  "separatorRegex": "/\d+/gm",
  "limit": null
} 

Output:

[
  "Hello",
  "world-",
  ",",
  ""
] 
Example 2

Input:

{
  "inputString": "Hello123world-456,2024",
  "separatorString": "o",
  "separatorRegex": "/\d+/gm",
  "limit": 2
} 

Output:

[
  "Hell",
  "123w"
] 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Transpose Record by Creating Arrays for Each Property Within Groups - IAP

Transpose the record by creating arrays for each property within the groups

Capabilities include:

  • This transformation allows IAP users to transpose the record by creating arrays for each property within the groups

Entry Point IAP Component

The primary IAP component to run Transpose Record by Creating Arrays for Each Property Within Groups - IAP is listed below:

IAP Component NameIAP Component Type
Transpose Record by Creating Arrays for Each Property Within Groups - IAPTransformation

Inputs

The following table lists the inputs for Transpose Record by Creating Arrays for Each Property Within Groups - IAP:

NameTypeRequiredDescriptionExample Value
arrayarrayyesAn array of objects
[
  {
    "item": "apple",
    "price": "42.2",
    "type": "fruit"
  },
  {
    "item": "banana",
    "price": "10.1",
    "type": "fruit"
  },
  {
    "item": "potato",
    "price": "20",
    "type": "vegetable"
  }
]
groupByPropertystringyesA property by which to group the input array
type

Outputs

The following table lists the outputs for Transpose Record by Creating Arrays for Each Property Within Groups - IAP:

NameTypeDescriptionExample Value
outputobjectAn object containing a list of objects organized by the groupByProperty value. Each property within the groups is transformed into an array
{
  "fruit": {
    "item": [
      "apple",
      "banana"
    ],
    "price": [
      "42.2",
      "10.1"
    ]
  },
  "vegetable": {
    "item": [
      "potato"
    ],
    "price": [
      "20"
    ]
  }
}

Query Output

There are no query output examples for Transpose Record by Creating Arrays for Each Property Within Groups - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "array": [
    {
      "item": "apple",
      "price": "42.2",
      "type": "fruit"
    },
    {
      "item": "banana",
      "price": "10.1",
      "type": "fruit"
    },
    {
      "item": "potato",
      "price": "20",
      "type": "vegetable"
    }
  ],
  "groupByProperty": "type"
} 

Output:

{
  "fruit": {
    "item": [
      "apple",
      "banana"
    ],
    "price": [
      "42.2",
      "10.1"
    ]
  },
  "vegetable": {
    "item": [
      "potato"
    ],
    "price": [
      "20"
    ]
  }
} 
Example 2

Input:

{
  "array": [
    {
      "number": 43,
      "president": "George W. Bush",
      "took_office": "2001-01-20",
      "left_office": "2009-01-20",
      "party": "Republican"
    },
    {
      "number": 44,
      "president": "Barack Obama",
      "took_office": "2009-01-20",
      "left_office": "2017-01-20",
      "party": "Democratic"
    },
    {
      "number": 45,
      "president": "Donald J. Trump",
      "took_office": "2017-01-20",
      "left_office": null,
      "party": "Republican"
    },
    {
      "number": 47,
      "president": "Joe Biden",
      "took_office": "2021-01-20",
      "left_office": null
    }
  ],
  "groupByProperty": "party"
} 

Output:

{
  "Republican": {
    "number": [
      43,
      45
    ],
    "president": [
      "George W. Bush",
      "Donald J. Trump"
    ],
    "took_office": [
      "2001-01-20",
      "2017-01-20"
    ],
    "left_office": [
      "2009-01-20",
      null
    ]
  },
  "Democratic": {
    "number": [
      44
    ],
    "president": [
      "Barack Obama"
    ],
    "took_office": [
      "2009-01-20"
    ],
    "left_office": [
      "2017-01-20"
    ]
  },
  "undefined": {
    "number": [
      47
    ],
    "president": [
      "Joe Biden"
    ],
    "took_office": [
      "2021-01-20"
    ],
    "left_office": [
      null
    ]
  }
} 

API Links

As noted on the JSON Schema Transformation (JST) Designer documentation for Using a Method, select the information (i) icon in the header of the method to be redirected to the Mozilla Developer Network JavaScript reference documentation for the method.

API NameAPI Documentation LinkAPI Link Visibility
IAP JSON Schema Transformation (JST) Designerhttps://docs.itential.com/docs/jst-designer-2023-1Public
Using Transformations in IAP Workflowshttps://docs.itential.com/docs/transformation-options-4Public

Additional Information

Support

Please use your Itential Customer Success account if you need support when using this Workflow Project.