How to NOT detect types for read range activity?

excel
activities

#1

Hello!
I have found an inconvenience with the read range activity. When the activity read a cell in a xlsx-file with numbers in it, it automatically categorizes what type it is. For example, if a cell contains 2.123,95 UiPath pass it as a string, and if another cell contains 01234 it passes it as a int32 but takes away the zero and write it as 1234, and also 1,234 becomes a decimal and then converted to 1.234.

So for my question, is there some way around the automated type recognition that is built in read range? If a cell contains 01234, read range still pass it ass 01234, and so on?


#2

Hi,

I’m not sure I can help provide a good answer for this but I know the Read Range works similar to Excel. 01234 in Excel is looked at automatically as 1234 and removes the zero by Default. If you want Excel to see it as a string then you need a ’ character infront like '01234 or use a formula =“01234”. You can also simply change the formatting of the cells to a zero-filled number with formatting “00000” but the value still does not include the zero or the number as a string.

So, in my opinion, I think as a workaround you need to put the ’ character infront to force it to a string or just change the formatting of the columns the way you would like to display the number.


#3

Hi Andreas,

I believe Read range activity takes values as is from the xlsx-file. For cell with value 01234 check how it is displayed in formula bar of excel sheet. Excel suppresses the leading zeros even for customized numeric cell formats and hence uipath takes away the zero as well. One workaround will be to convert your numeric cells in excel to text format. With this read range will consider 01234 as string and write it as 01234 itself.

Looking forward to other constructive ideas.

Regards,
Srinath


#4

Hi guys! Thank you for the input, unfortunately the excel-file comes from a third party and starting to manipulate the files is not really an alternative. Is there any other options?

Regards, AndreasB.