Field Split Node
Field Split Node
The Field Split node extracts a value separated by delimiters from an existing JSON payload. It will output a new JSON key to hold the extracted value.
Adding a Field Split node to your workflow
- First, select your desired solution and navigate to Rayven Workflow.
- Select ‘Functions’ from the left-hand panel.
- Find the Field Split node and drag it onto the canvas.
- Connect the Field Split node to your desired input node.
- Double click on the Field Split node to open its configuration window.
Configuring your Field Split Node
- Give your node a name. Choose something simple that clearly explains its purpose.
- Next, configure Split Out Field Value to split the value within the JSON payload by the specified delimiters.
- Under 'Field Variable Name', enter the JSON key that holds the value separated by the delimiters.
- Enter the delimiter character used in the value.
- Enter the index position of the value. Note that indexes start from 0.
- If you're only configuring the 'Split Out Field Variable Value', enter the output JSON key under 'Output Field Name'. Otherwise, move to step 3.
- Configure the 'Split Out Field Variable Name' to create a new JSON key from part of a value of another field.
- Under 'Field Variable Name', enter the JSON key that holds the value separated by the delimiters.
- Next, enter the delimiter character used in the value.
- Enter the index position of the value. Note that indexes start from 0.
Example 1
A field containing multiple values {'data':'aaa|bbb|ccc'} can have its first value extracted by selecting:
- ‘data’ as the Field Name,
- ‘|’ as the Delimiter,
- and 0 as the Index.
Entering ‘new_field’ as the Output Field Name will return 'new_field': 'aaa'.
Example 2
At other times, a field may be a concatenation of values, such as {'device_id_and_sensor' : 'METER_22225416369216_Resource-1.WTA'}. Here it may be necessary to split out WTA into a new field name. Setting:
- Field Name of Value to a data field (for example, ‘new_field’ from the case above),
- ‘device_id_and_date’ as the Field Name of Field,
- ‘.’ as the Delimiter,
- and ‘1’ as the Extract Index.
Will return 'WTA':'aaa'.
Example 3
It's also possible to carry out both actions. For example, for the field {'humidity' : '54%_123','device_id_and_sensor' : 'METER_22225416369216_Resource-1.WTA'} we can extract the field name (WTA) and the humidity (54) by setting:
- ‘Humidity’ as the Field Name of Value,
- Split Out Field Value:
- ‘_’ as the Delimiter,
- ‘0’ as the Extract Index,
- ‘Final_value’ as the Output Field Name, and
- Split Out Field Name:
- ‘Device_id_and_date’ as the Field Name of Field,
- ‘.’ as the Delimiter,
- ‘1’ as the Extract Index.
Will return 'WTA': '54%'.
As of Release: 08.12.2021