Data Table Picking Invalid row

Hi All,

I am trying to extract Data Table but along with first two rows its picking the last invalid row also. Something like this




It should only pick
but its picking the last invalid row also

@marina.dutta

Looks like even that is considered as separate row …

If so after reading the data you can filter on a column which you know that data would be present on it with empty data

Or else if it is last row extra always then dt.AsEnumerable.Take(dt.Rowcount-1).CopyToDataTable

Cheers

1 Like

@Anil,

The problem is the Data Table is not iterating the second row .Its only looping the first row. Even there is a valid row in second row.

I did something like this

1)Changed the second row to column and skipped the last row.



I am still getting last invalid row also its not iterating the second row

I am using following conditions


ExtractDataTable_CreditMemo.AsEnumerable().Any(Function(x) x(“ITEM NAME”).ToString.contains(“Usage”))

@marina.dutta

AI could not understand what you are trying

But

  1. Skip(1) will skip the first row but not the last
  2. As per if condition if any value contains usage in item name column then you are trying to do something

Cheers

@Anil,

I want to skip the first row as the First row gives column 1.column2 etc instead of Column Names.

Next I want to delete the last invalid rows which has no data

And also loop through the data table match the conditions like usage, support, services in the column name ITEN NAME and according to that Loop through each row of data table and enter the UI Activities.

In this case it should iterate only two columns, similarly whe there are three column it should iterate three columns and match the if conditions etc.

@marina.dutta

You mean you need to match in rows…then no skip is needed as your for loop with if condition any ways will skip it

Cheers

@Anil_G

I need to match whether the current row contains the column NAME(ITEM NAME) names usage, support, services .

Hi Anil,

I tried with check app state. Its working again only for first line item.

@marina.dutta

Did you use same check app state selector for all?

You should use different for each type of row

Cheers

@Anil_G

I used different. But Somehow its not entering values in other rows. Its identifying only one row.Usage the first row

@marina.dutta

Even the clicks are of different selectors only?

And you are using strict selectors?

Cheers

@Anil_G

Yea can you join around 10.30 in case you are available.

@Anil_G

Please join the meeting.

@Anil_G

Thank You for the Solution

1 Like

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