Get length Version 14 (Net)
Action group: Collections
Description
The action counts the number of elements in the selected collection.
Action icon
Action parameters
Input parameters
Parameter | Description |
---|---|
Collection or array | Collection or array to be processed. |
Output parameters
- The number of elements - the number of elements in a collection or array.
Settings
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Collection or array | Collection or array | Robin.Collection | Yes | |
Results | ||||
The number of elements | The number of elements in a collection or array | Robin.Numeric |
Special conditions of use
None.
Example of use
Task
There is a collection "Collection 1" with entries = Masha, Julia, Nastya, Olya. You need to count the number of items in the collection, write the result to a numeric variable "Quantity" and display the result on the screen in a dialog box.
Solution
Use the "Get length", "Show message" actions.
Implementation
Create a numeric variable "Collection" to which the action result will be written.
Move the "Get length" action to the workspace and set its parameters.
In the "Collection or array" specify the collection to be processed - "Collection".
In the "The number of elements" specify the "Quantity" numeric variable.
Move the "Show message" action to the workspace and set its parameters.
In the "Message text" field specify the "Collection" variable with the number of entries in the collection.
In the "Window title" specify the collection elements.
Start the robot by clicking "Start" in the top panel.
Result
The screen displays a message with the result number of the collection elements.