How to read multiple excel columns in DataTable


#1

Hi
How can I read multiple excel columns in DataTable? Let’s say in an excel sheet, Column D and Column E will have my data. It may span over any number of rows. So how can I read this data in datatable? In this case, Data Table will be of two columns and any number of rows.


#2

I guess you have asked similar question previously?

Regards…!!
Aksh


#3

Hi
It will be a workaround type. I am looking from some simple perspective.
Means, can this Excel=>Table=>Get Table Range Activity be of any help? What are these excel activities under “Table” headers?
ExcelTables


#4

Get Table Range Will return the whole table range exists in an excel not for particular table columns.

Get Table Range Extracts the range of an Excel table from a specified spreadsheet.
https://www.uipath.com/activities-guide/excel.table.get-table-range

Regards…!!
Aksh


#5

I guess you have asked similar question previously?

No, my question is slightly different. Means, my excel will be a configuration file and it may have many such tabular data depicting as configurable data. Some may reside in columns H & I, some may start on A & B. Also, if first row is supposed to be header, then it may have same names as well. Like A1 = “Account Numbers” and G1 also = “Account Numbers”.
So above approach may not work in this case.


#6

Get Table Range Will return the whole table range exists in an excel not for particular table columns.

I need some example of these activities. Your link only displays info about it. No example. :pensive:


#7

You can also give them a try by following info provided there. :slight_smile: try and try then you will also get something :slight_smile:

For your info just check the attachment:

The attached Example is using Above activity.

Regards…!!
Aksh


#8

Hey thanks @aksh1yadav
I went through the link and attachment in there. Though it directly does not answer my question, I got a perfect work around to get it done through Excel Table and reading its range into a Data Table.


#9

Have you tried using Range value in read range as "D:E"
Here is a sample. But it reads the entire row in UIPath and not just the usedRange.
Excel specific columns.zip (22.7 KB)


#10

Hi @Ganga_Bharani
I just tried your example. It worked. But when I simulated it in my example, it gave me “Object reference not set” error. May be I am doing some wrong. However, getting excel table range and converting it into data tables using Read Range activity suits my requirement perfectly as my excel is treated as configuration file and may have many such tables.