Leading zeros

Discuss RoboTask here
Post Reply
b_f_mcd@yahoo.com
Posts: 1
Joined: Fri Mar 15, 2019 5:49 pm

Leading zeros

Post 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.
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Leading zeros

Post 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
Oleg Yershov
juanlu
Posts: 46
Joined: Wed Jul 31, 2019 12:33 am

Re: Leading zeros

Post 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.
juanlu
Posts: 46
Joined: Wed Jul 31, 2019 12:33 am

Re: Leading zeros

Post 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.
Post Reply