Exists in Collection

This activity is used to find out if an item already exists in the collection.

Technical Reference

 

 

 

 

 

 

 

MISC

Collection: This indicates the name of the collection variable to which the item has been added

Display Name: Displays the name of the activity. You can also customize the activity name to help troubleshoot issues faster. This name will be used for logging purposes.

Item: This indicates the name of the variable which is already added to the collection.

Result: Declare and assign a variable to return the output. This is a Boolean value. This is not a mandatory field.

TypeArgument: This indicates the type of the argument which is going to be added. There are number of options from which we can choose.

*Mandatory fields to execute the workflow

The following activity illustrates on how we can use the exist in activity from the collections feature to find out if an item already exists in the collection.

Example:

We are continuing the workflow from (link), kindly refer.

1.      Drag and drop the Exist in Collection activity below the Write line activity.

2.      Click on the Exist in tab and fill the property box

3.      Add Name_Col to the collection box

4.      Add Name to the Item box.

5.      Enter the declared variable to the result box. Here it is “IsExists”

6.      Choose the TypeArgument as string, as the item which we need to find if it exists or not is a string

7.      Connect a WriteLine activity below the Exist in Tab to define an expression which gives an output for the activity.

8.      Enter the VB expression as “Item Exists:” +IsExists.ToString.

9.      Execute the workflow

 

The bot executes the workflow to show that the item exists in the Collection