How to store data outside of foreach

how do i store vlues that i get inside foreach to outside

okay it sound very confusing let me explain with a c# example

List<string> list = new List<string>();

foreach(var item in array)
  // now im storing each item to a list 

 list.Add(item.Replace(","," "));


now i can access all the item out of the foreach while i add them into a list

now my question is how can i do the same in ui path

1- i have created two list variable of string type a- list & b- output
2- inside foreach im giving and assign activity in the left I’m passing the output var
3- in the expression field I’m passing list.Add(item.Replace(","," "))

i was expecting that there should be no issue , but it seems like i cant do it like this way

Okay if figured it out itself , i have used Add to Collection activity to store data from item to list

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