Operations
This function allow you to manipulate both arrays and strings, making it possible to perform several operations with these type of data.
Array operationsβ
With this function you can manage the response of other functions, making it possible to operate with arrays.
Input parametersβ
Section | Parameters | Usage | Mandatory |
---|---|---|---|
General | Select Array Operations | Select in the list the operation you want to perform | Yes |
Source Array | The array to manage, usually the path to your data schema or a response variable of another function | Yes | |
Split* | Split into | Number of parts the array will be split into | No |
Preserve key | When set to YES keys will be preserved. Default is NO which will re-index the chunks numerically | No | |
Filter* | Select a Filter | Filters elements of an array applying filter function to each element | No |
Depth | Until which level within the array you want to apply the filter. This value must be between 1 and 10. The default value is 1 | Yes | |
Filter Parameters** | Needle | The value you are searching for | Yes |
Merge* | Source Array 2 | Joins the elements of one or more arrays together so that the values of one are appended to the end of the previous one. Example array1 | array2. The arrays have to be separated by vertical line β|β character. | No |
Insert Parameters* | Item to insert | The element that will be inserted at the end of the array. Beware: the item to be inserted is expected to be quoted in case it's a string, otherwise it will take it as an integer and inserts null. True/false would work as they would be inserted as true/false booleans. | No |
Reverse Parameters* | Preserve keys | When set to YES keys will be preserved. Default is NO which will reindex the chunk numerically. | No |
Search* | JSON Path | the JsonPath documentation. | No |
* This section of parameters will appear depending on the operation chosen in the input Select Array Operations.
This section of parameters will appear depending on the filter chosen in the input Select a Filter**.
Response parametersβ
Parameter | Content |
---|---|
array_result | Contains the result of the function. |
error | The error message if exist. |
Text functionsβ
Perform some transformations to texts inside a flow.
Input parametersβ
Section | Parameters | Usage | Mandatory |
---|---|---|---|
General | Text | The text to format. Usually a variable from your data schema or the output of another function. | Yes |
Method | The method that will be applied on the string | Yes | |
String Pad* | Length | The length of the pad | No |
Pad string | The pad_string may be truncated if the required number of padding characters canβt be evenly divided by the pad_stringβs length | No | |
Pad type | Choose to pad at right, left or both sides of the string | No | |
String repeat* | Multiplier | This value must be greater than or equal to 0. If the multiplier is set to 0, the function will return an empty string | No |
Uppercase words* | Delimiters | Every letter after these character will be capitalized. Default value is \t\r\n | No |
Substring* | Start position | Position to begin when cutting the substring. Default values is 0, starting from the begging | No |
Length | Length of the final string to be returned. If no value is specified and start position is 0 the complete string will be returned | No | |
String position* | Needle | The string you are searching for. | No |
Offset | Position to start searching from | No | |
String case-insensitive position* | Needle | The string you are searching for. | No |
Offset | Position to start searching from | No | |
String replace* | Search | String to be replaced. | No |
Replace | New string to be appended | No | |
Preg match* | Pattern | Pattern you are using to find matches in a text | No |
Preg replace* | Pattern | The pattern to search for | No |
Replacement | The text to replace by the pattern found on the subject text | No |
Response parametersβ
Parameter | Content |
---|---|
result | Output of the function performed. |
error | Error message if exists. |
JSON PATHβ
Operatorsβ
Operator | Description |
---|---|
$ | The root element to query. This starts all path expressions. |
@ | The current node being processed by a filter predicate. |
* | Wildcard. Available anywhere a name or numeric are required. |
.. | Deep scan. Available anywhere a name is required. |
.<name> | Dot-notated child |
['<name>' (, '<name>')] | Bracket-notated child or children |
[<number> (, <number>)] | Array index or indexes |
[start:end] | Array slice operator |
[?(<expression>)] | Filter expression. Expression must evaluate to a boolean value. |
Filter Operatorsβ
Filters are logical expressions used to filter arrays. A typical filter would be [?(@.age > 18)]
where @
represents the current item being processed. More complex filters can be created with logical operators &&
and ||
. String literals must be enclosed by single or double quotes ([?(@.color == 'blue')]
or [?(@.color == "blue")]
).
Operator | Description |
---|---|
== | left is equal to right (note that 1 is not equal to '1') |
!= | left is not equal to right |
< | left is less than right |
<= | left is less or equal to right |
> | left is greater than right |
>= | left is greater than or equal to right |
=~ | left matches regular expression [?(@.name =~ /foo.*?/i)] |
in | left exists in right [?(@.size in ['S', 'M'])] |
nin | left does not exists in right |
subsetof | left is a subset of right [?(@.sizes subsetof ['S', 'M', 'L'])] |
anyof | left has an intersection with right [?(@.sizes anyof ['M', 'L'])] |
noneof | left has no intersection with right [?(@.sizes noneof ['M', 'L'])] |
size | size of left (array or string) should match right |
empty | left (array or string) should be empty |