Sort
Overview
The sort deluge task sorts the elements of a list, in an ascending order if the specified boolean value is true, or in descending order if the specified boolean value is false.
The boolean value is not mandatory. If it is not specified, the elements are sorted in an ascending order.
Note
- In a string list, special characters, upper case, and lower case letters are sorted in the following order:
! " # $ % & ' ( ) * + , - . / : ; < = > ? @ <capital letters> [ ] ^ _ ` <small letters> { | } ~
Return
- List
Syntax
Parameter | Description |
---|---|
<variable> (optional) | Variable which will contain the returned list. |
<list> | The list variable whose elements will be sorted. If the list contains elements of different data types, the function will return null. Data type is List. |
<boolean_value> | Applicable values are: true or false. Data type is Boolean. |
This task can be used in the following events
When a record is Created | ||
On Load | Yes | |
On Validate | Yes | |
On Success | Yes | |
On User input | Yes | |
Subform on add row | Yes | |
Subform on delete row | Yes | |
When a record is Created or Edited | ||
On Load | Yes | |
On Validate | Yes | |
On Success | Yes | |
On User input | Yes | |
Subform on add row | Yes | |
Subform on delete row | Yes | |
When a record is Edited | ||
On Load | Yes | |
On Validate | Yes | |
On Success | Yes | |
On User input | Yes | |
Subform on add row | Yes | |
Subform on delete row | Yes | |
When a record is Deleted | ||
On Validate | Yes | |
On Success | Yes | |
Other workflow events | ||
On a scheduled date | Yes | |
During approval process | Yes | |
During payment process | Yes | |
In a Custom Function | Yes | |
In an Action item in report | Yes |
Example
Let's say we have a list variable "colors" which contains the values {"red", "blue", "green", "yellow"}
The first and second snippets shown below will sort these elements in ascending order. The third snippet will sort the elements in descending order.
colors.sort(true);
colors.sort(false);