RPA ClassCast error for Calculated Expression type variable

rpa
rpaexpressplugin

#1

Hi,

I am copying two values from excel and pasting in Number type variable in WPA Express, after that i am trying to do subtraction and assigning to third variable using expression:

${currenttotal} - ${previoustotal} to calculate the difference between two number type variables.

I am getting below error:

java.lang.String cannot be cast to java.math.BigDecimal
java.lang.ClassCastException: java.lang.String cannot be cast
to java.math.BigDecimal
at

com.workfusion.studio.rpa.recorder.model.dto.expression.BigDecimalExpressionHandler.lambda$process$16(BigDecimalExpressionHandler.java:44)
at java.util.HashMap.forEach(HashMap.java:1288)
at com.workfusion.studio.rpa.recorder.model.dto.expression.BigDecimalExpressionHandler.process(BigDecimalExpressionHandler.java:42)
at

Can anyone please help me on this.

Thanks
Prince


#2

@prince_sidana,

please post your zipped recording folder here, and also the excel file. You can hide sensitive info if any


#3

the main question is your number format in excel and examples of these numbers


#4

Issue.zip (9.5 KB)

Hi,

Please find the attached RPA as well as sample excel sheet.
When i am trying to copy excel value in Number variable it throws NumberFormat Excpetion.

Thanks
Prince


#5

Hi, @prince_sidana
Here is a working solution. Better to use built-in Excel action

We will investigate your case
recording-1501767424681.rar (1.7 KB)


#6

Prince,

Your approach gives error because the value you copy from Excel contains a new line symbol at the end, so you need to trim it.

See IF Else not working