Skip to main content

Collection Tools Connector

Collection Tools Filter, sort, map, de-duplicate, chunk, and aggregate lists and objects, and validate data against JSON or XML schemas.

Actions​

Add Key/Value to Object​

Add a value to an object with the given key

InputCommentsDefault
ObjectThe object to add the key/value pairs to. Accepts a JSON object or a reference to an object from an earlier step.
KeyThe key to set on the object. When Insert Path is set, the key is added under that path.
ValueThe value to set for the key on the object.
Insert PathOptionally define a path using dot notation of where to add the key/value

Add Multiple Key/Value to Object​

Add multiple key/value pairs to an object

InputCommentsDefault
ObjectThe object to add the key/value pairs to. Accepts a JSON object or a reference to an object from an earlier step.
Insert PathOptionally define a path using dot notation of where to add the key/value
Dynamic Key/ValuesA JSON object whose properties are added to the top level of the object. When provided, this input takes precedence over Key/Values, and Insert Path is ignored.
{
"someProperty": "value"
}
Key/ValuesKey and value of the properties to add to the object, under Insert Path when it is set. Ignored when Dynamic Key/Values is provided.[]

Aggregate​

Apply aggregate function to list

InputCommentsDefault
ListReference to a list of data to operate on
Aggregate FunctionAggregate function to apply (choose from AVERAGE, COUNT, MAX, MIN, SUM, PRODUCT, MEDIAN).
Filter FunctionFilter out any elements that do not return true(item, index) => { return true; }

Append​

Append element to the end of the list

InputCommentsDefault
ListReference to a list of data to operate on
ElementThe item to append to the end of the list

Apply Field Mapping​

Create a new object from a source object, using the rows of a Field Mapping to copy each source field to its destination field.

InputCommentsDefault
Field Mapping RulesThe field mapping rules to apply. Expects a Field Mapping config variable: an ordered list of rows, where the key of each row is a source field and the value is a destination field.
Source ObjectThe object to map data from. Expects a reference to an object, for example the result of an earlier step.

Chunks​

Chunk the list into lists of the specified number of elements

InputCommentsDefault
ListReference to a list of data to operate on
Number of ElementsNumber of elements to take1

Combine Collection (Deprecated)​

This version of the action is being deprecated. Please replace action with Create Object.

InputCommentsDefault
CollectionsReturns an object with the specified key and corresponding collection as the value[]

Concatenate​

Concatenate two lists together into a single list

InputCommentsDefault
ListReference to a list of data to operate on
ListReference to a list of data to operate on

Count​

Count the number of occurrences of element in list

InputCommentsDefault
ListReference to a list of data to operate on
ElementReference to an element to look for

Create List​

Create a new list with the given inputs

InputCommentsDefault
List ItemsThe items to include in the new list, in order.[]

Create Object​

Creates a new object from provided key/value pairs

InputCommentsDefault
Key & Value PairsThe key/value pairs to build the new object from. Each key becomes a property of the object.[]

De-duplicate​

De-duplicate the elements of the list

InputCommentsDefault
ListReference to a list of data to operate on

Field Value Mapping​

Maps the values from two different collections and returns a key/value list where the 'key' is the value of the Key Mappings input and the 'value' is the value of the Value Mappings input

InputCommentsDefault
Key MappingsA key/value list where each key names a field in Value Mappings and each value is the key to use for that field in the output.
Value MappingsThe source values as key/value pairs, looked up by the keys in Key Mappings.[]

Filter​

Filter elements of a list

InputCommentsDefault
ListReference to a list of data to operate on
Filter FunctionFilter out any elements that do not return true(item, index) => { return true; }

First​

Get first element from a list

InputCommentsDefault
ListReference to a list of data to operate on

Flatten​

Flatten an array of arrays into a single array

InputCommentsDefault
ListReference to a list of data to operate on

Key Value Pair List to Object​

Convert a Key Value list to an Object

InputCommentsDefault
Key/Value ListA JSON array of objects, each with a key and a value property, to convert into a single object.

Last​

Get last element from a list

InputCommentsDefault
ListReference to a list of data to operate on

Length​

Count the number of elements in list

InputCommentsDefault
ListReference to a list of data to operate on

Map​

Transform a list and its elements

InputCommentsDefault
ListReference to a list of data to operate on
Transform (map) FunctionFunction to transform each element(item, index) => { return item; }
Filter FunctionFilter out any elements that do not return true(item, index) => { return true; }
Context DataAdditional contextual data to supply to the transform and filter functions

Object to Key Value Pair List​

Convert an Object to a Key Value List

InputCommentsDefault
ObjectThe object to convert. Each property becomes one key/value pair in the returned list.

Process In Order​

Ensures that payloads are processed in order across executions according to an ordering specified by a payload attribute. Returns the largest possible set of ordered payloads on the Process branch, and otherwise follows the Skip branch and returns the current item.

InputCommentsDefault
Collection IDA value that uniquely identifies the collection that is being processed out of order.
Collection LengthThe number of items in the collection. When processing is finished the interim data for the collection is removed.
ItemThe current item to consider for processing.
Item IndexThe integer value to consider as the index for the current item that specifies intended processing order. 0 is the first index value.

Remove​

Remove all occurrences of an element from a list

InputCommentsDefault
ListReference to a list of data to operate on
ElementReference to an element to look for

Select Item From List by Index​

Select an item by index from a list of items, supports nested lists

InputCommentsDefault
ListReference to a list of data to operate on
IndexThe zero-based positions of the items to select. Items are returned in the order the indexes are listed.[]

Sort​

Sort elements using a JavaScript comparison function

InputCommentsDefault
ListReference to a list of data to operate on
[
{
"name": "Widget",
"prop": 25
},
{
"name": "Thingy",
"prop": 10
},
{
"name": "Whatsit",
"prop": 19
}
]
Sort Comparison FunctionSort elements by the given comparison function. See MDN documentation for compare function documentation.(a, b) => { return a.prop < b.prop ? -1 : 1; }

Take First​

Take first number of elements from a list

InputCommentsDefault
ListReference to a list of data to operate on
Number of ElementsNumber of elements to take1

Take Last​

Take last number of elements from a list

InputCommentsDefault
ListReference to a list of data to operate on
Number of ElementsNumber of elements to take1

Validate JSON Schema​

Validate a JSON input against a given schema, returning errors if the JSON input is not valid.

InputCommentsDefault
JSON ObjectThe JSON object to validate against the schema.{"someProperty":"value"}
JSON SchemaThe JSON schema to validate the input against.
{
"type": "object",
"properties": {
"someProperty": {
"type": "string"
}
},
"required": [
"someProperty"
]
}

Validate XML Schema​

Validate an XML input against a given XSD schema, returning errors if XML is not valid.

InputCommentsDefault
XMLThe XML object to validate against the schema.
XML SchemaThe XSD schema to use in validation.