ClearCollection

Estimated reading: 2 minutes 1544 views

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.

Properties

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.

* Represents mandatory fields to execute the workflow

Use Case

Here we are going to automate and demonstrate the utilization of Collections feature. The following activity illustrates on how we are going to clear the name which we added to the collection of lists. Here we are continuing from the Add to collection activity, so, we are going to clear the name in the following example.

Steps to execute the bot

Let’s continue building,

1. Now, Drag and drop Clear collection activity and connect it below Write line activity.
2. From the properties panel, add the variable “Name_Col” 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.

Share this Doc

ClearCollection

Or copy link

CONTENTS