Add or Remove values from a collection using UiPath
So many times while designing processes we use lists, let’s see how we can add or remove values from the collection which is a list.
Let’s see the practical implementation of this in UiPath:
Step1: Drag and Drop an Assign activity and initialize a list of an integer as shown below:
Step2: Adding values to this list using an Activity called Add to the collection which is shown below:
We are adding two values to our list as shown above.
The parameters are as described below:
- Collection- This is the initialized list name.
- Item- Value that needs to be entered in the list.
- TypeArgument- Which datatype that you are entering into the list.
Step3: Finally let’s see the count of values that are added into the list.
The output is as shown below:
Now we will see how to remove values from the list that is created earlier.
We will use the same list to remove the values:
Step1: Drag and Drop Remove From Collection Activity to designer panel and mention the parameters as shown below:
Step2: Now the value is removed from the list and we will now see the list count as output which is shown below:
This is how we can add or remove values from a collection using UiPath Activities.
If you want to remove the list value which is dynamic then we can’t really use this.
For removing values at a certain index follow this post which will help you to achieve this task click here.