When to use the Clear Collection activity
This activity is used to clear all the existing data stored in the collection.
Figure 1
Activity Name |
Picture |
Clear Collection |
|
Technical Reference
Figure 1.1
Select the TypeArgument based on the variable declared in the AddtoCollection.
Scenario
In the previous case, we stored the employee data of those who have been working for more than 10 years. From this, we removed the employee data of those who have less than 3 years of experience. Now, the requirement is to clear the data of employees with less than 10 years of experience in the organization from the collection.
Illustration
Activity: To clear the entire data from the Collection, use ClearCollection activity.
Drag a ClearCollection activity and connect the activity to False branch under the Count Validation to clear the entire data once the number of iterations has crossed the collection count. (refer figure 1.1)
- Go to the property section and fill in the details, enter the variable name as Add under "Collection" field which was already declared for AddToCollection process
- In the aforementioned scenario we selected the TypeArgument as "String", the same condition needs to be applied here to clear the entire data from the collection.