string.split action
The string.split 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 to 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.
A timestamp is split into the date and time components using "T" as the delimiter:
Fields: "dateTtime"
Input: "2020-05-01T12:34:56Z"
Delimiter: "T"
The output of this trigger action will be:
{"date": "2020-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" - In this example comma(,) is used which can be replaced with any string or a Unicode. The delimiter used to separate the Fields parameter needs to be the same as the delimiter used in the Delimiter parameter. |
Input | String | Yes | A character delimited string specifying values. For example, "21,35,19" - In this example comma(,) is used which can be replaced with any string or a Unicode. |
Delimiter | String | Yes | The delimiter used to separate individual values the Fields and Input strings. For example: "," (comma). |
Parse as CSV | Boolean | Choose True for RFC 4180 CSV parsing and False for a simple string split logic. |
It is possible to use any string or Unicode character as a delimiter. Use of a double quote qualifier is supported when the delimiter ("," comma for example) is one character long. 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:
(using the example data provided in the parameters section, above). |