Data format question

Hi,
I use get text to read data from a web page which is "00012 " into a variable “data1”. But when I use writecell data1 I am only getting “12”. How can I fix this?

Also, I have to combine two variables data2 and data3 to writecell.
data1 = ‘00’ and data2=‘012’
When I use data3 = data1 +data2 (String variable types)
and use writecell, I am losing starting zeroes.

Please help.

Thank you,

@A_Learner

In excel to make a number as string…you can write the data eith a leading single wuote which would write it as string and would retain the zeros

Eg: in write cell or while writingg data write it as '00012 instead of 00012

Also you can try first usingn format cells activity and format the cell as string and then write

Cheers

@Anil_G how to append that single ’ to the variable? If it is 00012 I can do that.

Thank you,

@A_Learner

Use assign with variable = "'" + variable

Cheers

Hi @A_Learner

->Make sure that the column for which you are appending is of type string.
->Use the write cell workbook activity and give the cell value and it will write as per your requirement.

Please check the below screenshot for your reference.


Regards

Hi @A_Learner

In Write Cell Activity, In Value field. Append with ' at starting.

Like: "'00012" OR "'"+Value

Hope it helps !!
Happy Automation :uipath:

1 Like

hIE @A_Learner
I"m attaching sample screen shot hope you find your answer…

cheers Happy Automation

1 Like

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