Sort Version 13 (Net)
Action group: Collections
Description
The action sorts the collection in the specified order. You can sort only homogeneous collections in which all elements are of the same type.
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Collection | Collection for processing | Robin.Collection | Yes | |
Sort order | Sort order | Robin.String | Yes |
Special conditions of use
- For numeric items, sorting is done by value, for text items by alphabetical order, and for all other items by length.
- After sorting, a new indexing is assigned.
Example of use
Task
There is a variable "Collection 1" with a list of countries.
It is necessary to sort the records in descending order (alphabetically), get the value at index "0" and output the found city in the dialog box.
Solution
Use the actions "Sort", "Show message", "Get value by index".
Implementation
- Assemble a robot scheme consisting of actions:
- Set the "Sort" action parameter.
- Set the "Get value by index" action parameter.
- Set the "Show message" action parameter.
- Click on the "Start" button in the top panel.
Result
The program robot completed successfully.
The collection is sorted in descending order, and a dialog box with the country "Japan" is displayed.
Обзор
Инструменты контента