Remove object Version 16 (Net)

Action group: Collections


Description

The action removes an object from the collection by its index or value

Action icon


Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
CollectionCollection for processingRobin.Collection
Yes
IndexThe index of the element to removeRobin.Numeric
No
ValueThe value of the element to removeRobin.Object
No
Results
ResultThe resulting variable containing removed valueRobin.Object

Special conditions of use

The resulting collection will be stored in the action parameter "Collection".

If you specify an index and a value at the same time, the action will accept only the index, not the value, as input.

Case:

"Collection 1" contains:

  • 0. Russia
  • 1. Japan
  • 2. Germany

If you specify the parameters index "1", and the value "Germany" in the action, "Collection 1" will take the following form:

  • 0. Russia
  • 1. Germany

Example of use

Task

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

It is necessary to delete the value with index "0" . Then get the values with indexes "0" and "1" and output the results in dialog boxes. 

Solution

Use the actions "Remove object", "Get value by index", "Show message". 

Implementation

  1. Assemble a robot scheme consisting of actions:


  2. Create variables with the type "Object": 


  3. Set the parameters of the "Remove object" action. 


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


  5. Set the parameters of the "Get value by index 2" action. 

  6. Set the parameters of the "Show message 1" action. 


  7. Set the parameters for the "Show message 2" action. 


  8. Launch the robot using the "Start" button in the top panel. 

Result

The required object is removed from the collection (value "China"). Two dialog boxes with the countries "Japan" and "Russia" are displayed consecutively. 

  • Нет меток