IF Else not working

faq

#1

I’m having trouble with the IF/Else statement. I pull cell data from excel in number format, set it to a variable (which is number) but it doesn’t work.


RPA ClassCast error for Calculated Expression type variable
#2

I think your clipboard action should be set variable value from clipboard, i.e., to ‘totalprice’.


#3

No, still not working. I set up a simple test with an excel sheet. The cells are formatted as numbers, and RPAx stops when it reaches step 10:

Sheet:

Script:

And variable:

Any tips? Kinda stuck without IF/else not working.


#4

change cellvalue type from number to string? not sure whether it works.


#5

No, did that as well, received an error:

So, until this works, RPAx needs to rely on excel mending the gaps.


#6

@CWaago-Hansen_PwC1 - when you copy some value from excel bu CTRL + C - you copy the value itself + CR LF (new line symbol).

In the upcoming release, we will introduce the Trim function which solves this problem .

Meanwhile, you can use this workaround - https://superuser.com/questions/543615/copy-from-excel-without-line-break

You can also use the Excel action in RPA Recorder - https://kb.workfusion.com/display/RPAe/Excel


#7

Thanks azinchuk, the workaround did it. The Excel action wouldn’t work here as I had opened the workbook, or am I wrong here?
Anyway, the workaround worked for both number and string variable.


#9

@azinchuk
This one is pretty common. Can we please post it to our KB?


#10

Described here https://kb.workfusion.com/display/RPAe/Clipboard