Insert collection Version 10 (Net)
Action group: Arrays
The action inserts the collection into the list by index. Defaults to the beginning of the list.
Action icon
Parameters
Input parameters
List - list for processing.
Index - index in the list.
Collection for inserting - the collection, that will be inserted in the list by the specified index.
Settings
Property | Description | Type | Filling example | Mandatory field |
---|---|---|---|---|
Parameters | ||||
List | List for processing. | Robin.Collection | Yes | |
Index | Index in the list | Robin.Numeric | No | |
Collection for inserting | The collection, that will be inserted in the list by the specified index | Robin.Collection | Yes |
Special conditions of use
For Java:
- If the "Index" field is not filled in, the collection for inserting is placed in the beginning of the list.
For Net:
- If the "Index" field is not filled in, the collection for inserting is placed in the end of the list.
Example of use
Task
There is a variable "Collection-1" with 3 records:
- 0. Jane
- 1. Mary
- 2. Kate
Variable "Collection-2" has 2 records:
- 0. John
- 1. Peter
Add "Collection 2" records to "Collection 1". Output the total number of "Collection 1" values in the dialog box and check the value by index "0".
Solution
Use the "Insert collection", "Show message", "Get value by index" actions.
Implementation
- Assemble a robot scheme with the actions:
- Set the "Insert collection" action parameters.
- Set the "Show message" action parameters.
- Set the Get value by index" action parameters.
- Run the robot by clicking "Start" in the top panel.
Result
A dialog box was displayed with the number of items in "Collection 1".
The value at index "0" was obtained. Since the values from "Collection 2" were placed at the end of the "Collection 1" list.