Assign: Input string was not in a correct format (Comparing 2 Double Type Variable)

Hi

I’m Comparing the Two Different Double Type Value, I’m Fetching the 1 Value Using the Get Text So It will come in String Type So I Convert it into the Double And Flow is Going On…

But when the Get Text Value is Empty it is throwing the Error “Assign: Input string was not in a correct format.”

How Do i Solve this

Hello @kishan.savaliya ,

You need to put a condition before parsing the value to double to avoid this error.

You can try the below method to get it done :
YourDouble_Val = If(Double.TryParse(YourStrValue,Nothing),Double.Parse(YourStrValue),0)

Regards,
Rohith

1 Like

you can add a condition to check if it is empty and based on that proceed

1 Like

Also, You can use it to check trim text if null
if(strTxt.Trim IsNot Nothing, Double.Parse(strTxt), 0)

1 Like

You can add try catch activity on assign to handle the exception every time when there will be empty value

1 Like

Thanks a lot @rohith.prabhu

Thanks @Lak_Ui

Thanks @Zain_Ahmed

Thanks @ahmad_sarrawi

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