How to convert UIPath.Core.GenericValue into a string array

Hi

Can i know how to convert the Generic Value to a string array so that i can iterate through the content.
I have used copy selected text activity in which the default variable type it storing is GenericValue.
Is there any possible option to convert this variable type to string array.

Thanks

image

just change variable type

You want to change dynamically while running the script ?

Hi,

When i am changing the Variable Type in the Variables it showing compilation error.

You have to use Assign activity and change GenericValue as string and assign to System.String variable.

1 Like

Hi @Bonagend ,
Copy selected text activity don’t support array type.
just create a new string variable from variable pane and pass to the output property of Copy selected text.(It doesn’t have to be generic type .it does accept string)

string

Looks like you’re using copy selected text to copy data form notepad which is stored one below the other. If this format of input data is always going to be the same; use the Split method and use the newline character as the separator. this will return you every element as a separate string in a string array.
Hope this helps.
If you still don’t get how to go about this, let us know. someone or the other will surely help further.

assign the texts to a string variable str .

then assign str.ToString.Split({" "},StringSplitOptions.None) to stringArray.

Now you got your array.

1 Like

Hello
I have an issue simlira to yours I think. Is anyone that could help me ?

Thanks