Search text in Dynamic Data table whose column name and Number keep changing

Hello All,

I am passing data from Excel to application. As per search result i am scrapping Data table.
I need to search “text” any where in table and relevant Row no. But the problem is No. of columns and there position gets change as per search result. I used below two methods to search -

  1. ExtractedRow(“Column-8”).Equals(“String to search”) or ExtractedRow(“Column-6”).Equals(“String to search”)
  2. ExtractedRow.ItemArray.ToList().Contains(“String to search”)

Issue with first method - When “Column-6” not found it gives error - Column-6 doesn’t exist. Because for some of the record Column-6 is not present in data table.
Issue with Second method - I am not able to find column name in which “String to search” present.

What I need is, First Cell value of the column in which “String to search” is present.
and how handle such kind of dynamic data table.

Attached screen shot shows data of Data table converted into Excel.

Thanks,
Harshwardhan

Hello,

You can check “LookUp Range” activity to get the cell value, from that you can take the column headder or row number

Thanks,
Meg

Hello Harsh,

You can loop through all the rows from data table and then all the columns to get the row and column position of particular text (search text). This may be slow for huge data.

Hope attached workflow will be helpful to resolve your issue:
GetColumnIndex.xaml (15.3 KB)

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