sortList
A Workflow Engine function that sorts a JavaScript array (a list) using the standard Array.sort()
function.
This function is available as a feature of the Add-ons v2.5 download and later.
This function is available for event, alert, and Situation workflows.
Back to Workflow Engine Functions Reference.
Arguments
Workflow Engine function sortList
takes the following arguments:
Name | Required | Type | Description |
---|---|---|---|
| yes | string | The source field (CEvent or |
| no | string | The destination field to write the sorted list to. |
Example
Given a custom_info
containing the following lists:
custom_info : { list1 : [ 99, 1, 10, 23, 37, 6 ], list2 : [ "a", "z", "p" , "c" , "ping" , "dog", "ox" , "fool" } }
If a workflow contained two sortList
actions the resulting custom_info
would be:
"custom_info": { "list1": [ 1, 10, 23, 37, 6, 99 ], "list2": [ "a", "c", "dog", "fool", "ox", "p", "ping", "z" ]