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

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
CollectionCollection for processingRobin.Collection
Yes
Sort orderSort orderRobin.String
Yes

Special conditions of use

  1. For numeric items, sorting is done by value, for text items by alphabetical order, and for all other items by length.
  2. 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

  1. Assemble a robot scheme consisting of actions: 
  2. Set the "Sort" action parameter.
  3. Set the "Get value by index" action parameter. 
  4. Set the "Show message" action parameter.
  5. 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.

  • Нет меток