System Sollection Generic List System String as a text

Hello I use get attiribute to get selected items attribute and it is being saved as:

image

I would then want to copy the content of it but I can’t, I tried write line activity but I can’t choose the variable because of the data type. Could you please advise how can I change System Sollection Generic List System String the way that I can copy it?

Hi @anon40731888

String.join(" ",listvariable)

`

Does not work

@anon40731888
Try using the syntax in the write line

String.join(" ",listvariable)

What is the datatype of the list? List(of ______)?

HI @anon40731888

Can you try with this

string.Join(Environment.NewLine, list1.ToArray())

image

list1 is the name of my variable?

It works but it shows it like list:
image
And I need to have it in one line if you know what I mean

I need it in the form as UI Explorer says:


But I can’t copy from here :frowning:

Yeah your variable only

It worked I made an error sorry.

Assign myList = New List(Of String) From {“Item1”, “Item2”, “Item3”}
Assign concatenatedString = String.Join(“,”, myList)

Log concatenatedString

Yeah I can’t get the Join to work either. Not sure what’s happening. I’m on UiPath.System.Activities 22.10.7 what version are you using?

It worked eventually, I first used it in text editor and it did not work and then I changed to expression editor and it worked

Yup I upgraded to UiPath.System.Activities v23.4.3 and it instantly started working.

image

image

image
Yeah all good it works!

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