Error when created a simple String variable

Hello guys,

I’m trying to do a simple process that just copy a text selected in a web browser.
After used a “Control A” hot key I put the “Copy Selected Text” component.
Then in the panel Properties>Options>Result I created a variable string called “ResultAVT” (control K)

But an error appear for me:
Compiler error(s) encoutered processing expression…

You can see in the attached image.

Any sugestions to fix it?

Hi @Ladimir_Abdala

it looks like the type is different can you try creating the variable by pressing ctrl+k in the result field

Or try creating the variable as string and then assign it there

it looks weird to see this error


Hi @Ladimir_Abdala

Can you try to create the new variable and delete this one and check it


Dear Gokul001, I tried it but the result is the same.

Dear Anil_G, I did it like you mentioned, but the error appear again in the same format.

I bet you have ResultAVT defined multiple times in different scopes. Use the universal search and type in ResultAVT and I bet you see multiple results returned.

1 Like

Hi @Ladimir_Abdala

Can you delete the activity activity and put it again.

I did it.
The answer was “No results found”

I did it, 3 or more times. :pensive:

The answer can’t be no results found. You aren’t doing the search correctly.

Click the magnifying glass in the upper right corner. Click Universal Search. Click All Files. Delete any existing search text and type in your variable name.

You’re right.
Here is the result of search:

OK that shows you only have it defined once in Main.xaml

Notice you have Current File selected, not All Files. But maybe you only have one file anyway.

Delete the variable from the variables panel, then put your cursor in the activity’s Result field, press CTRL+K, and create a new variable. Then look in the variables panel to see the datatype.

I’m wondering, though, why are you using Copy Selected Text? If you’re trying to get text from a web page or something, there are better ways (like the Get Text activity).

1 Like

Dear postwick, I don’t no why, but I did like you recommended and the error disapered.

No errors now :slight_smile:

For your information, I will get the selected text with the Hot key “Control A” and paste it in a Excel file.

Thank you so much.

This isn’t a good way to do things. You should use the Get Text activity to get the text and store it in a variable, then you use Excel activities to write to Excel - you don’t copy/paste to get data and put it into Excel.

Have you done the free UiPath Academy training? It covers how to do basic things like getting text from the screen and how to work with Excel files.

1 Like

Thanks for the tips.
I’m just starded the Uipath training.
I already did another basic training.
I’ll take care and look in the training how to work with Excel files. :handshake:

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