How to read excel data row wise?

image
This is my excel data i want to read the data by A headers
for eg: rowname is “engine protect” then it will give output “test1”

Hi @Vinit_Mhatre

You can use For each row in datatable in classic design
image

In studioX you will find for each excel row
image

Regards
Sudharsan

yes i know this but how can we read data from row header?
in generally ,
image
if i want to read the first column data then we use this "row(“engine protect”).tostring

but what about this scenario?
image

@Vinit_Mhatre

Try like in the image

Hi,

If your table has just 2 columns, I recommend to use Dictionary as the following.

dict = dt.AsEnumerable.ToDictionary(Function(r) r(0).ToString,Function(r) r(1).ToString)

Sample20220804-6.zip (2.5 KB)

Regards,

what if i have dynamic range of the data ? this dictionary will work or not?

Hi,

Can you give us an example?

Regards,

if today i have 3rows of data … then tomorrow it will become 100rows

You can try like the above image i have shared @Vinit_Mhatre it will loop until the last row whatever the count may be

Hi,

Probably, no problem. it will work. Please note that each value of the first column must be unique.

Regards,

Hello @Vinit_Mhatre
Try this
1.Read the Excel file , store it as DT_input
2. Use lookup Data table activity


3. enter Column index 0 if it is A, for B,C increment with 1, example B=1, C=2, D=3
4. Pass the DT_input
5. Type the Required Lookup value like, “engine protect”
6. In properyies . Set colunn index 1 to look column B
7. Set output varaibale as string

print message box and pass out put variable.
you can get column B value respect to column A