string.split action

This trigger action splits an Input string and Fields into arrays of strings by separating the string into substrings, using a specified delimiter that determines where to make each split. Each field string array values (Fields) are matched with the corresponding input string array (Input).

In the following example 'T' is used as the delimiter and in the output each array element in the Fields get paired with the corresponding array element in the Input. For example, you can split a timestamp into the date and time components using "T" as the delimiter as follows:

Fields: "dateTtime"
Input: "2017-05-01T12:34:56Z"
Delimiter: "T"
The output of this trigger action is {"date": "2017-05-01", "time": "12:34:56Z"}

Action

This trigger action is found under the String heading.

Canvas

When dragged onto the canvas, the appearance of the action is a rectangle with two routing points.

The left routing point (red) is the failure route. This route will be taken if there is an error during execution.

The right routing point (green) is the success route. This route will be taken if action executes successfully.

Form

Parameters

Name

Type

Required

Descriptions

Fields

String

Yes

A character delimited string specifying field labels. For example, "field1,field2,field3" (a comma delimited string).

Input

String

Yes

A character delimited string specifying values. For example, "21,35,19" (a comma delimited string).

Delimiter

String

Yes

The delimiter used to separate individual values for the Fields and Input strings. For example, comma (,).

Use any string or Unicode character as a delimiter. Using a double quote qualifier is supported when the delimiter is one character long, such as a comma (,). For example, field1,"field, field","field3" will be split into "field1", "field, field", and "field3".

Action variables

Name

Type

Description

$(action.X.value)

Array

The resulting array.

For example, {"field1":"21","field2":"35","field3":19"}