How can I add an element in a list while looping through the list?

hello

i have a
try catch
for each element in list

catch
add element in list

but it gives me an error if i do that, is there any way to bypass this message : [Collection was modified; enumeration operation might not execute]

thanks

Hi @adext

Did you initialize the list variable as New List(Of String)

Regards

hello yes it’s a list

Hi @adext

Before looping through the list to add the items did you initialize. If possible share the screenshot of the flow.

Regards

You can’t. You’ll have to create a secondary list, add items to it during the loop, then after the loop you can concatenate them so it’s all in one.

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