READ cell Activity using variable

I am having excel sheet inside some headers are there,

Headers are started in Row 5 ,

i need read cell Activity to read the Coulmn cell values instead of using A , B , C Coulmn name i want to read excat Coulmn name to read the excel in read cell Activity how to do that , any suggestions,

One more things this Coulmn name dynamically came in variable how to put read cell range variable in dynamically and read the respective values

@BHUVAN

If you leave the range as empty then ideally the bot will automatically try to read the data from the first filled row that is row 5…

cheers

1 Like

Hi @BHUVAN

You can read the whole sheet using the Read Range activity by giving the starting range as A5. In the Read Range property, uncheck the Add Headers field, so that the column data comes just as data row.

Then use the following query in the Assign activity:

columnNamesArray = yourDt.AsEnumerable.Take(1).CopyToDataTable.Rows(0).ItemArray.Select(Function(item) item.ToString).ToArray

This will give you the names of all columns in an array.

Hope this helps,
Best Regards.

In assign activity what variable type i have to mention can u help me

@BHUVAN

columnNamesArray is a variable of type Array of String. Please take a look at the modified expression above.

Hope this helps,
Best Regards.