Remove value or an item from a List using UiPath

A lot of times we use list or arrays while automating a business process.

We always either add values to a list or remove them from the list according to our requirements while designing the workflow.

So, let’s see the implementation of this task on how to remove value or an item from a list.

Step1: Drag and Drop an Assign Activity and initialize a list as mentioned below and it is an integer type.

remove value or an item

Step2: Drag and Drop an Add to Collection Activity to add the values to that list as shown below:

remove value or an item

Here:

  • Collection: It is the parameter where you need to provide your created list variable name.
  • Item: It is the value that is added to the list.
  • TypeArgument: It is the type of data type that you created your list for.

Step3: Now, we have created our list and added values to it. Let’s see how we can remove values from a list.

Drag and Drop an Invoke Method activity and set up the properties as shown below:

remove value or an item

Here:

TargetObject: It is your List Name.

MethodName: RemoveAt

RemoveAt where you need to provide the index value of a list which you need to remove that value.

Go to the properties panel and go to parameters and create an argument as shown below:

remove value or an item

Here i provided the input argument index value as 0.

So, it will remove the first value which is added in the list.

This is how you can remove value a particular value from a list by providing the index value.

Happy Learning!

Like this post then let your friends know about this-:

Leave a Reply

Your email address will not be published. Required fields are marked *