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
Property | Description | Type | Filling example | Mandatory field |
---|---|---|---|---|
Parameters | ||||
Collection | Collection for processing | Robin.Collection | Yes | |
Index | The index of the element to remove | Robin.Numeric | No | |
Value | The value of the element to remove | Robin.Object | No | |
Results | ||||
Result | The resulting variable containing removed value | Robin.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
- Assemble a robot scheme consisting of actions:
- Create variables with the type "Object":
- Set the parameters of the "Remove object" action.
- Set the parameters of the "Get value by index 1" action.
- Set the parameters of the "Get value by index 2" action.
- Set the parameters of the "Show message 1" action.
- Set the parameters for the "Show message 2" action.
- 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.