Remove duplicates Version 1 (Java)

Action group: Collections


Description

The action removes items with duplicate values from the collection. Duplicates will be checked only in elements with type "Boolean", "String", "Numeric", "Data-time", "Point coordinates", "Folder path", "File path".

Action icon

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
CollectionThe collection from which to remove elements with duplicate values. All changes will be saved to the same collection.Robin.Collection
Yes
Consider the caseIf the value is «true», the value comparison will be case-sensitive. If «false», it will not be case sensitive.Robin.BooleantrueNo

Special conditions of use

The original collection is checked for elements with repeating values and returns the same collection but without these elements.

  • The comparison may take a register into account - depends on the value of the corresponding input parameter.
  • If the element values are the same, but it is an element of a different type, it is not considered a take.
  • Empty elements (elements with empty value) of the same type will be considered as doubles and deleted. Empty elements of different types are not considered doubles, so the action will not compare and delete them.
  • If the collection has no takes, the action returns the collection unchanged.
  • Duplicates are checked only for elements with type "Boolean", "String", "Numeric", "Data-time", "Point coordinates", "Folder path", "File path". Elements with other type are ignored when searching for duplicates
  • The modified collection is saved to the original collection.

Example of use

Task

There is a collection of 3 records with a doublet:

It is necessary to delete the double. Then, get the collection values by indices "0" and "1". 

Solution

Use the "Remove duplicates", "Get length", "Get value by index" actions. 

Implementation

  1. Assemble a robot scheme consisting of actions:


  2. Set the parameters of the "Remove duplicates" action.


  3. Set the "Get length" action parameter.


  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. Click on the "Start" button in the top panel. 

Result

The program robot completed successfully. There are 2 records left in the collection (Harry and Charlie).

  • Нет меток