How to read cell a Double Variable value, if it is empty sometimes

I have a problem with reading a cell with a double value. Most of the time this cell is empty and if it contains a value, it is always a double so I set the Output as Double. The problem is, when the cell is empty, reading it would give a “DoubleConverter value cannot convert from null”. So I tried setting the value as “String” instead, but doing this would sometimes give me an “StringConvert Cannot convert from System.Double”. I know I can just add “0” on the cell when it’s empty, but I know that there might be some time that they would forget to add one.

Hi,

Can you try GenericValue type (UiPath.Core.GenericValue) ?

Regards,

1 Like

It works well if there is an existing value. But it gives an “Object reference not set” error when empty. I tried adding a default value “0” on the variable. It still gives the same error.

Hi,

Can you try to check if it’s null or not, using if activity, in advance?

For example, condition will be the following.

cellValue isnot Nothing

Regards,

It returns “True” when I try IsNothing(cellValue). I guess I’ll just add an If else with assign with this.

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