Excel and workbook read range behaving differently during Read Range

I am using Read range activity to read a data table containing date fields (dd/MM/yyyy).
image

  1. read range using excel

output is : >

COlll1
20/06/2019
31/10/2019

  1. read range using workbook
    output is :

COlll1
6/20/2019
10/31/2019

I have attached the workflow.Test.xaml (8.5 KB) Test.xlsx (7.9 KB)

  • I am expecting read range using workbook to give the output as (dd/MM/yyyy).
    20/06/2019
    31/10/2019
  • Also Read range of excel is taking more time to execute(when the number of row items is heavy)

Please help.

Hi @MariaJosephina

Check this

assign row(“COlll1”).toString=Datetime.ParseExact(row(“COlll1”).ToString,“MM/dd/yyyy hh:mm:ss”,System.Globalization.CultureInfo.InvariantCulture).ToString(“MM/dd/yyyy”)

Thanks
Ashwin S

I have to iterate the entire Datatable to assign this value, right.

I don’t want to iterate. I just want to know why there is a varying behaviour for these 2 activities.

Hi @MariaJosephina,

Please deselect the option called “PreserverFormat(Slower) in workbook & PreserveFormat in Excel” Read range to avoid the date formate problems.

Please do let us know if you find any difficulty.

Thanks
Sukesh V
UiPath

@Sukesh_V

When I am removing the preserve format option, getting the date field as MM/dd/yyyy hh:mm:ss
Is it possible to get the date field always in dd/MM/yyyy ?

Excel :

COlll1
06/20/2019 00:00:00
10/31/2019 00:00:00

Workbook

COlll1
06/20/2019 00:00:00
10/31/2019 00:00:00

The region and data format for system is already set as dd/MM/yyyy

Ideally, it should read the date field from excel in the same format as configured in the system configurations.

Sorry for the delay in my response @MariaJosephina.

I am exactly not sure about why this is happening because my side is working fine Excel.
I will look into that.

for your requirement, As @AshwinS2 already mentioned, Converting date format is the only option for now.

Thanks
Sukesh V

1 Like

ok noted @Sukesh_V and @AshwinS2

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