sortKey
Overview
The sortKey function sorts the keys in a collection containing key-value pairs.
Syntax
<collectionVariable>.sortKey(<booleanValue>);
where,
Parameter | Data type | Description |
<collectionVariable> | COLLECTION | The variable in which key value pairs will be sorted. |
<booleanValue> (optional) | BOOLEAN | Applicable values are true and false. The value true sorts in ascending(default) order, and the value false sorts in descending order. In a string list, special characters, upper case, and lower case letters are sorted in the following order: |
Examples
productVersion = collection("Creator" : 5, "CRM" : 2, "Mail" : 8); productVersion.sortKey(); // Collection becomes {"CRM":2,"Creator":5,"Mail":8}