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

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
Main listList for processing.Robin.Collection
Yes
Second listAdded listRobin.Collection
Yes
IndexThe 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

  1. Assemble a robot scheme consisting of actions:


  2. Set the parameters of the "Add a collection" action. 


  3. Set the parameters of the "Show message" action. 


  4. Set the parameters of the "Get value by index" action. 


  5. 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.


  • Нет меток