How can I store text obtained from a browser, using the ‘get-text’ function and a ‘for-each’ loop, for multiple iterations (e.g., 4 times) , and then display the full array containing all the collected text? @Anil_G @Palaniyappan
Fine
Welcome to UiPath forum
- First have a list variable created using assign activity like this
List_output = New List(Of String)
Where list_output is a variable of type System.collections.Generic.List(of String)
-
Now use a for each loop and inside the loop use GET TEXT Activity and save the value in a variable named Strinput
-
Inside the same loop use a ADD TO COLLECTIONS activity where mention the item property as Strinput and collections property as list_output
Now all the values obtained will get saved in the collection list variable
Then u can use it as a list or as array by converting to array like this
arr_output = list_output.ToArray()
Or
You can get that as a string like this
Stroutput = String.Join(“-“, arr_output)
Hope this helps
Cheers @GopiKrishnan_Srinivasan
Welcome to Community!!
Try this
Assign: collectedText = collectedText.Concat({currentText}).ToArray
you can use list instead of array
create an listvariable and initialize it new list(of string)
in the for each loop use assign activity
listvariable=listvariable.append(yourstring).tolist
outside the loop use log message
string.join(“,”,listVariable)
is this you are expecting
but ADD TO COLLECTION is not showing!
you can also use assign activity
listvariable=listvariable.append(strinput).tolist
There are many ways to add it a list
Use can search for this append item to collection
https://docs.uipath.com/activities/other/latest/workflow/append-item-to-collection
Thank You ! I got the desired result
Cool
Then would recommend to close this topic
Cheers @GopiKrishnan_Srinivasan
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.