Extract Device ID's Node
Extract Device ID Node
The Extract Device ID node can define the timestamp and device ID associated with a payload. It is useful when you want to reassign a payload to a different device or split an array object into individual JSON objects for separate processing downstream.
This node outputs multiple JSON objects if you enter a Subgroup Path. Otherwise, it outputs a single JSON object.
Adding an Extract Device ID node to your workflow
- First, select your desired solution and navigate to Rayven Workflow.
- Select ‘Functions’ from the left-hand panel.
- Find the Extract Device IDs node and drag it onto the canvas.
- Connect the Extract Device IDs node to your desired input node.
- Double click on the Extract Device IDs node to open its configuration window.
Configuring your Extract Device IDs node
- Give your node a Name. Choose something simple that clearly explains its purpose.
- Next, define the Device ID the payload is associated with:
- Enter the Device ID Field. The payload should have a JSON key that holds the device ID value configured in Device Management. If this key does not exist, you can create it with a JavaScript Node. If the JSON key changes, use a wildcard (*) at the beginning or end of the field name to use the first located field.
- Enter the delimiter used in the Device ID field. Type '[space]' in square brackets to enter a space.
- If using a delimiter, enter the index position of the Device ID. Note that indexes start from 0.
- 'Add to Existing Device ID' allows users to append the extracted Device ID to a parent device ID.
- 'Take Device ID from Key' allow users to take the Device ID from the Field Name (JSON key) instead of the Field Value.
Subgroup paths
Subgroup paths enable users to extract data from an array of objects. They provide routes to Device IDs that are not in the parent JSON. For example, if deviceID is part of the child JSON, ‘child’, the path would be child.deviceID.
- Under 'Subgroup Path', enter the JSON key that holds the array of objects you want to extract.
- Select 'Take Only Subgroup' if you want the JSON array split into and passed on as individual JSON objects. This option is only relevant when using a Subgroup Path.
- If you have a Subgroup Path and select 'Take Only Subgroup', configure the filter field to pass only JSON objects that meet specific criteria.
- If you have set the Subgroup Path, selected 'Take Only Subgroup' and entered a Filter Field, specify a 'Filter Value' to pass only objects with the value given.
The Split Delay is mandatory and defaults to 500ms. We recommend using 500ms or more to allow sufficient time for the workflow to process the payload.
Determining timestamps
If you want the timestamp of the data to match the timestamp of data coming from the device, you will need to define three fields:
- Date Field Name: Enter the JSON key that holds the timestamp value.
- Date format: Define the format for the existing data. For example, 'dd/MM/yyyy' or 'HH:mm:ss'.
- Timezone: Select the timezone of the device that recorded the data. If the date format is EPOCH or EPOCHMS, you can leave this section blank.