Kindly suggest me How to get values based on column name
lets assume you can rely on the structure then you could slice the tables into pieces in order to get a name, value structure
e.g. take Col1,Col3, take Col5, Col7…
hi @seti.nadeem !
You have multiple options, will explain 2 of them below:
If you want a specific single value, you can use the following syntax:
- Important: DT start with index 0 on both rows and columns
It is recommended to work in Column-Based DT, since with coordinates, if you ever have a formatting change, the coordinates might point to a wrong cell, but looking at your input, and if it is always structured like that, this would work.
If by “Columns” you refer to your 1st Row item: (Name, last name, Date, Amount) What you can do is a for each row activity, and when the following condition is true (If Activity)
row(0).toString.Equals("last name") → Where “0” is the 1st column
row(2).toString → Where “2” is the 3rd column
→ This would return “Kumar”
If we use For Each row in datatable we get value row by row and then we can get all values that comes below names column or ramesh colums or age colums.
but in this case I want to access all values right to names, all values right to last name all values right to date and amount.
I hope it is clear now.
Hi @seti.nadeem , you can use the Lookup Data Table activity, to find the row index, and then use that index to get your desired value:
I did put columnindex as variable, since I noticed that on column 5, you have another set of “names” like Age, desig or no.exp.
If you’d like to check on that column, just changing the “0” to “4” would work.
The “+2” on the following expression, is to point directly to the value that we want, skipping the empty value in the middle. this would also work on the 5th column.
DataExtract.zip (44.4 KB)