Page 1 of 1

Leading zeros

Posted: Fri Mar 15, 2019 5:54 pm
by b_f_mcd@yahoo.com
I am reading social security numbers from an excel file and they are formatted as "000-00-0000" Robotask drops the leading zero on the number. I have searched everywhere i the forums and cannot figure out how to fix this.

Re: Leading zeros

Posted: Sat Mar 16, 2019 4:00 pm
by Oleg
Look at this parameter (see screenshot)
Image

If you use default parameter (General format (auto)) then EXCEL set this value as a number and suppresses lead zeros
Use "Set values as text" value. In this case EXCEL set value as-it-is and set the cell format to text

Re: Leading zeros

Posted: Fri Aug 16, 2019 4:34 pm
by juanlu
Hi Oleg,

We have this very same issue. The problem is not set the cell values, but to get them.

In our case we are using the Excel plugin to open a CSV file, reading one cell and saving it into a variable. We have done this a lot in the past and works perfectly. The problem is that now is not text what we want to get, but instead is a number with leading zeros. These zeros are gone using this method.

Is there something else we can do? I tried with the Set Cell Format action, but without luck. Another option would be the Text Loop, but this would be more complex, because we want to save a lot of values to variables, which you can do with only one action with Excel Get Cells.

Kind regards,
Juanlu.

Re: Leading zeros

Posted: Sun Aug 18, 2019 10:02 pm
by juanlu
For now I have solved this using a RegEx Match action, saving the found expression to variable and then using multiple (many) Set Variable actions. Not ideal, but it works. If there is a way of doing this with the Excel plugin, I'm all ears.