cancel
Showing results for 
Search instead for 
Did you mean: 

Delete specific row from a collection

JustinBishop
Level 4
Is there anyway to tell BP to delete a specific row(s) from a collection other than the first or current row?
12 REPLIES 12

StuartWood
Staff
Staff
No, I'm afraid there's no random access for collections; ie. you can't read from, write to or delete an arbitrary row in the collection.

RohithSrinivas
Level 3
How do we remove the first row ?

ShreyansNahar1
Level 4
You cannot delete, but you can copy specific rows from a collection to another collection using a Collection Manipulation Utility.

Anonymous
Not applicable
You can extend the Collection Manipulation Utility and add a code stage to delete a specified row. Try duplicating an action like Copy Row where you need to supply an index and change it, placing a collection.Rows(index).Delete() somewhere and output a new collection

pramod_a_kumar_
Level 2
you can do via code stage.

JiriPospisil
Level 4
Depends on details, but you could probably use 'Filter Collection' action in 'Utility - Collection Manipulation' BO. Filter would be something like ""Field 'valueyoudontwanthere'"", as Output select same collection as input and there you go.

JoakimEklund
Level 6
Do you know before hand what rows to delete you could just loop the collection with a counter and in a decision stage delete the row when the counter reaches the specific number.

IvanGordeyev
Level 5
Supporting joakimeklund. This is by far the best method. When you establish which row needs to be deleted. - Start a loop; - Everytime a loop runs add 1 - When Row to be deleted is the row of the loop, use object - Internal - Collections - Action Remove Row.

If you wanna remove rows without any logical condition then this solution can help.

Let's say you wanna keep only 1st row and remove all other rows OR you wanna keep the first 5 rows, 10 row,s etc any number of rows that you're sure of,

25534.pngUsing the Copy Rows action, you can pass start row and from there how many rows you wanna copy. So in the above example, it will keep only the first row and remove all others.

------------------------------
Thanks & Regards,
Tejaskumar Darji
Sr. RPA Consultant-Automation Developer
------------------------------