Variable ErrorL invalid lvalue expression reference expressions cannot end with conversion

studio

#1

Hello,

I am very new to UIPath. Simply following tutorials. I created sequence with a input box last night; very simple one.
year mod 4 = 0
if this true It should say “Leap” if not “Not Leap”

For some reason today year variable giving me an error. There is little blue mark next to variable; “invalid lvalue expression reference expressions cannot end with conversion” It doesn’t work.

This is from log: The private implementation of activity ‘1: DynamicActivity’ has the following validation error: Compiler error(s) encountered processing expression “year”.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.
at System.Activities.Validation.ActivityValidationServices.ThrowIfViolationsExist(IList`1 validationErrors, ExceptionReason reason)
at System.Activities.WorkflowInspectionServices.CacheMetadata(Activity rootActivity, LocationReferenceEnvironment hostEnvironment)
at UiPath.Workflow.ViewModels.MainViewModel.IsWorkflowValid()

I stuck in this simple step. Hope someone can help me! Thanks


#2

in “if condition” use

now.Year mod 4 = 0 ------- false

(now.Year-1) mod 4 = 0 ---- true
(This may not be 100% correct logic if using in real time)

or

DateTime.IsLeapYear(now.Year) ---- boolean


#3

Thank you very much. I don’t think the boolean expression is wrong. I am doing exactly same as in tutorial. I figured when I add variable with ctrl +k I am getting error with my flowchart and variable. I realized someone also was getting error from the youtube comment.


#4

May be the syntax is wrong, if you can please paste the screenshot or share your xaml


#5

If I add variable from input out put with right click. I am getting this error.
If I create year variable from variable tab. Then go type year into output. That works.


#6

Please check the attached xaml and check if you are missing something

leapyear.xaml (5.6 KB)


#7

Thank you for taking your time. It seems fine.

I added more to the project. Again I am getting input error in blue. "One or more children as validation errors or warnings"
This time I tried to create variable in variable section. It didn’t solve the problem.

I can’t attach xaml because I am a new user guess.


#8

Is it still the same error? Or something to do with the scope?


#9

I think it’s same error because by the time I create variable in input that blue error appeared.


#10

Cant check now (on mobile) but if I remember correctly InputDialog returns a GenericValue.
You need to convert it afterwards to an int - f.e. year.ToInt32

Either way whenever you see this error it means that something in your expression has wrong variable Type.


#11

Thank you Andrzej. Generic value should be OK with int, bool, string and couple more but not decimal one.In tutorial he is basically using default values. No converting. I start thinking that I am using 60 days trial version and that might be the reason. I am not even in the place that I want to be in tutorials because errors occurred at the very beginning. (If you see my other post not being able to record)

Thanks
Kyre


#12

Hey @kyre

Will you tell me it shows when you have changed the data type of that variable then it was occurred?

and let me know this is working for you?

FirstFlowchart.xaml (14.9 KB)

Regards…!!
Aksh


#13

Hey Aksh1yadav,

Thank you very much for asking this. I restarted my computer and surprisingly it worked today. I didn’t have to change any variable.

Best
Kyre


#14

Great to know but also clarify this?

Regards…!!
Aksh


#15

Hi kyre,

I am also new to the UiPath and faced same issue. I don’t know why the issue occurred. I have made some changes which resolved the issue for me. Hope it helps for you as well.

I have followed the same steps as in the tutorial while creating the sequence. To create a Input dialog,

  1. Dragged the input dialog activity and changed properties in Properties pane.
  2. In the Output property, created a variable by right clicking and selecting Create Variable (Ctrl + K)

Solution: I have removed that value from result. Typed “ye” and waited for the variable list to display and selected the variable “year” from that list.

And now, there is no error!!!


#16

similar experience;) Thanks


#17

I didn’t changed anything! Thanks!


#18

Hi,

I have encountered exactly the same problem when doing the tutorial and I found this thread by googeling the error message.

If I create the year variable like the tutorial video suggest by using “Create Variable” by right clicking into “Results” in the “Output” section of the “Input dialog” and change the type to Int32 in “Variable type” at the bottom, it produces the error message:
“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.”

If I create a second variable (year2) by using “Create Variable” in the “Variables” section and using that one for the output, the error message is avoided.

Interestingly enough, if I now change the output back to the original year variable, the error message disappears as well (I think this in line with the previous replies to this thread).

I think this is a bug in UiPath. It looks like the variable type might not be correctly updated when using the short cut method to create variables. This should either be fixed or the tutorial video should be changed to avoid future confusion. I’m using UiPath 2016.2.6344.

Cheers,
Dirk


File not found exception when searching typesnot
#19

this is a know issue, thank you


#20

Hi there. Is there any solution to this problem? I am unable to assign variables using the “Result” field from user dialogs without getting this error. I am testing with a single sequence with only 1 variable and 1 dialog and can’t even run that. I’ve tried restarting, uninstalling, re-installing and still the problem persists. Please help.

Thanks.