List: Sort items and save to a new list
Use this action to sort the values in a JSON array and save the values to a new array.
This action is typically part of a process that involves Web API actions or JSON fields. A common application for this action is to filter a JSON array created using the XML: Convert XML to JSON action, or using this action to prepare a JSON array for use in another system.
How to configure this action
This action will sort the JSON array entered in the List Field using the Sort order. For example, to sort an array of random numbers into ascending order, set the Sort order to ascending
.
Fields for this action
-
List Field
- Enter the array to sort. Enter a valid JSON array or a
{{field-reference}}
for a field containing a JSON array.- An example of valid JSON array format is:
[ "Value3", "Value1", "Value2" , "Value4" ]
- An example of valid JSON array format is:
- Enter the array to sort. Enter a valid JSON array or a
-
Sort order
- Choose either ascending or descending sort order for the array.
- For example, if set to ascending:
[ "Value1", "Value2", "Value3"]
or if set to descending:[ "Value3", "Value2", "Value1"]
-
Return Field Name
- The name of the field where the result is saved
What will this output?
This action will output a new valid JSON array with sorted results that match the sort order.
Output fields for this action
-
Return field name
- The field name will be the return field name defined during configuration. The output will be a sorted JSON array, for example,
[ "Value1", "Value2", "Value3"]
.
- The field name will be the return field name defined during configuration. The output will be a sorted JSON array, for example,
Thanks for your feedback
We update the Help Center daily, so expect changes soon.
Link Copied
Paste this URL anywhere to link straight to the section.