Clear collection

The Clear collection activity helps to clear the items that were added to the collection. This activity can be used with Add to collection only.

Technical Reference:

 

 

 

 

 

MISC

Collection: This indicates the name of the collection variable to which the item has to be 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.

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

Example:

As we are connecting this activity under Add to Collection activity, kindly refer the before steps in ( Link ).

Let’s continue building,

1.      Now, Drag and drop Clear collection activity and “Name_Col” connect it below Write line activity.

2.      From the properties panel, add the in the collections tab.

3.      Select the Type argument as “String” from the drop-down list.

4.      Drag and drop another write line activity below to the Clear collections activity to ensure whether the item has been removed from the collection.

5.      Enter VB expression as “Final Value” + Name_Col.Count.ToString in the box.

6.      Now, execute the workflow.

The bot will execute and return the output in the output window. The initial value will be zero before adding the item and after adding the item to the collection, it displays as 1. Once it clears, it displays as zero again.