Add items to Array String

Hello everyone, I searched the forum but I did not find the solution to my problem.
image

I have an excel file which I save in a DATATABLE.

I browse the DATATABLE with the following condition:

If the date is >= today’s date, I have to add it in an array to be able to delete it later because I can’t use the “delete a row” activity in a foreach

I used the “add to collection” activity but it still returns me the current items

I would like to be able to add these elements in an array to make a filter later in my datatable and to remove the dates which are not >= to the current date

Merci pour votre aide

Hi @DimitriLYR

Use a list instead…Arrays size is fixed…List is what you need to use

and use this
https://docs.uipath.com/activities/docs/append-item-to-collection

cheers

1 Like

Thanks for the reply, here is what I did:


image

However when I do a foreach, I only have one item (the last)
I would like to add all the elements of my DataTable that match my condition

image

image

Hi @DimitriLYR

That is because you are everytime appending the output with new list

Please use same collection in in and out

cheers

@DimitriLYR

Please see on how to add the elements

Make sure you initialize the list

output
image

Hope this helps

cheers

1 Like

Thanks ! I

had initialized my list in the foreach… Beginner’s mistake, so my list is reinitialized each time…

Thank you again

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.