Sort Version 13 (Net)

Action group: Collections 


Description

The action sorts the collection in a specified order. You can sort only homogeneous collections in which all the elements are of the same type

Action icon


Parameters

Input parameters

ParameterDescription
CollectionCollection to be processed.
Sort orderSort order.

Output parameters

Result - the result collection will be saved in the "Collection" action parameter.

Settings

Property

Description

Type

Filling exampleMandatory
Parameters
CollectionCollection to be processed.Collection
yes
Sort order

Sort order


Dropdown list:

  • ascending
  • descending
Stringascendingno
Results
This action has no result. The result collection will be saved in the "Collection" action parameter.

Special conditions of use

For numeric elements, sorting is done by value, for text elements alphabetically, and for all others by length.

After sorting a new indexing is assigned. 

Example of use

Task

There is a "Collection 1" variable with the list of the countries:

Sort the entries in descending order (alphabetically), get the index value "0" and display the found city in the dialog box.

Solution

Use the"Sort", "Show message" and "Get value by index" actions. 

Implementation

  1. Assemble a robot scheme with the action:


  2. Set the "Sort" action parameters.


  3. Set the "Get value by index" action parameters.


  4. Set the "Show message" action parameters. 


  5. Click "Start" in the top panel to start the robot.

Result

The collection was sorted in descending order, and a dialog box with the country "Russia" was displayed.

  • Нет меток