Add a collection Version 7 (Java)
Action group: Collections
Description
The action adds the specified collection of items to the list. By default, at the end of the list.
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Main list | List for processing. | Robin.Collection | Yes | |
Second list | Added list | Robin.Collection | Yes | |
Index | The ordinal number of the position where the collection should be inserted. Numbering starts from 0. | Robin.Numeric | No |
Special conditions of use
None.
Example of use
Task
There is a variable "Collection 1" with 3 records:
- 0. Jake
- 1. Jacob
- 2. Mary
Variable "Collection-2" has 2 records:
- 0. Ava
- 1. Joseph
You need to add "Collection 2" records to "Collection 1" by default to the end of the list. Output the total number of "Collection 1" values in the dialog box and check the value at index 4.
Solution
Use the "Add a collection", "Show message", "Get value by index" actions.
Implementation
- Assemble a robot scheme consisting of actions:
- Set the parameters of the "Add a collection" action.
- Set the parameters of the "Show message" action.
- Set the parameters of the "Get value by index" action.
- Launch the robot using the "Start" button in the top panel.
Result
A dialog box with the number of items in the collection 1 is displayed.
The value at index 4 "Joseph" was obtained because the "Collection 2" items were added to the end of the "Collection 1" list.
Обзор
Инструменты контента