cancel
Showing results for 
Search instead for 
Did you mean: 

Which action to use if I want to read excel file in different data types of columns.

Hello,

As we've seen generally Read Excel actions provide all data columns as Text data type.

But I've some columns which are in Date format, DateTime format, Number format, etc, and in the collection, I want that column datatype as Date, DateTime, Number, Text, etc as per data present in that excel column.

Whatever I tried so far gives all columns as text format so Is there any action that assign data type accordingly?

------------------------------
Thanks & Regards,
Tejaskumar Darji
Sr. RPA Consultant-Automation Developer
------------------------------
2 REPLIES 2

Hi Tejas, 

In my view, there is no inbuilt action to differentiate the data type while getting excel data into a collection.

But you achieve this in different ways.

1. You need to create a predefined collection (with fields and data types defined) and read the excel data column-wise instead of all columns at a time. Later you can merge the collections to get the final collection.

2. Another workaround but it depends on the process,- If you want to loop through the collection data, the same can be done directly on excel(by getting the last row and incrementing rows) even you can manipulate it there itself.

------------------------------
Murali
RPA Consultant
------------------------------

VedSengupta
Level 6
Hello Tejaskumar,
Just a suggestion. Why not use a global code stage to type cast data?
And using that function in code?

Link 1:  c# - Convert datatable to list of generic type - Stack Overflow
Link 2: DataColumn.DataType Property (System.Data) | Microsoft Docs

------------------------------
------------------------------
Best Regards,
Ved Sengupta
RPA Developer
Deloitte India (Offices of the US)
Bangalore | INDIA
*If you find this post helpful mark it as best answer*
------------------------------
------------------------------
------------------------------ Best Regards, Ved Sengupta RPA Developer Deloitte India (Offices of the US) Bangalore | INDIA *If you find this post helpful mark it as best answer* ------------------------------