Array Sort
Use this action to sort an array in the specified order.
Using Array Sort Action
To use this action in your workflow, connect it to ThingWorx Flow. To connect to the flow, do the following:
1. Click and drag the Array Sort action under the Operations utility to the canvas, place the pointer on the action, and then click or double-click the action. The Array Sort action window opens.
2. Edit the label name, if needed. By default, the label name is same as the action name.
3. To sort an array, in the Source Array Stringify or Reference field, enter the source array stringify or reference. You need to input an array of same data type.
4. Click + to enter the additional fields information:
a. In the Sorting Based on Property field, enter the key on which the sorting is made.
This option is applicable only if the input array has objects with the same keys. If the source array contains objects and you do not provide any key, no sorting occurs.
b. In the Sorting Order list, select one of the following option:
Ascending
Descending
5. Click Done.
Output Schema
The Array Sort action returns an output schema as shown in the figure that follows:
Was this helpful?