Can't save the 'Get Text' as a variable in the very first lesson; 'returnText' is not declared

I’m getting the following error:

Compiler error(s) encountered processing expression “returnText”. ‘returnText’ is not declared. It may be inaccessible due to its protection level.

I tried deleting it and starting again but I got the same error. Why is this happening? Thanks.

Create the variable first then assign it to the get text activity

1 Like

Hi, I tried this but got the error

Invalid L-value expression.:Reference expressions cannot end with Conversion. The provided expression’s type must exactly match the type T of VisualBasicReference or LambdaReference.

delete get text activity, create string variable of returnText and add get text activity in flow assign the variable to it.

Don’t create the variable using Ctrl+T as it will create it as generic type.

Hi, tried this and got a new error:

Remove the default value and try again

Tried this, still getting the same error

change variable type of returnText to Generic … check if you are still getting the same error

basically if it is generic value you can not store it in string and vice versa.

Here I am using output random string in both the get text:

When I assign string variable for the 1st time to Get Text activity after dragging it in the sequence it will accept output as string only and if I assign genericValue for the first time to Get Text as output variable type then it will not accept string.

Is there a solution to this?
I am getting the exact same compile error which I cant get rid even if I change variable type to GenericValue or string.

Hello everyone,

A way that worked for me is doing the next thing:

  1. Delete the steps with getText and messageBox from the “Do” sequence
  2. Select the “Do” Sequence (as a visual indicator that the right window is selected, you will see it with a different border - also i’ve attached a picture at the bottom)
  3. Click on Create variable → name it returnText (do not change anything else)
  4. add the messageBox widget
  5. add the getText widget between the clickAccept widget and messageBox widget
  6. proceed as instructed in the video and complete the getText actions (now you should also have autocomplete in the Value text on the right side of the screen
  7. proceed as instructed in the video for the message box widget (now you should also have autocomplete for the part after the +)

I don’t understand this framework completely but doing the exact above steps fixed the problem for me. I encountered all the issues mentioned above while trying something different as suggested by the other members. Maybe it’s a bug in the framework :slight_smile:

1 Like

I had tried , it worked for me thank you :slight_smile: