How can i attribute index to rows

i have a data table and i need to attribute to every rows an index,

after that i want to use data filter to keep only the rows i matching with a specific conditions

And the goal is to double click on a cell in SAP corresponding to the good index maching in the data filter

@Soudios

Check below for your reference

How to use the index

Also you can use Lookup Datatable and pass the value, also you can create a variable in Index to get the row index

Hope this will help you

Thanks

@Srini84
thank you but the video is about : How to Calculate difference between two Time Values using UiPath|| RPA UseCase

@Soudios

Yeah, but you can relate your case as how I have take the Index and use in For Each loop

maybe this is not the case, then can you provide some screenshots?

Thanks

Every row already has an index.

If you want to filter your datatable, you don’t need indexes.

https://docs.uipath.com/activities/docs/filter-data-table

@Srini84
I need to double click on the amount located in column “EUR brut”
But only if

  • column T contains “SA”

But also if in the 2nd row

  • N°pièce
  • Date pièce
  • column T

is similare at the fisrt row then double click again on the amount on the row 2 located on column “Euro Brut” and so on.

For example A i need to double click 3 times

@Soudios

Use Do While loop for looping purpose

you need to inspect the selector of those rows like you can get the row selector, which will always be different

create a counter which will increment according to the loop

And use Get Text activity to extract the row value and also use IF condition to check whether “SA” is present

Use Double Click activity inside that

Hope this will help you

Thanks

@Srini84
i have more than 15000 rows it take too long time, i think it better to use data filter after data scraping to select only the rows with “SA” and then double click if the 2 rows are similaire for example

Do you have a sample plz ?

Whether you loop through the 15000 rows or filter first, you’re still looping through those 15000 rows (the filter has to loop too). 15000 rows is nothing. Stop worrying about it. You have to get to millions of rows before any performance difference is noticeable.

ok but how can i do to have

if
row.item(“Date de pièce”) = row.item(“Date de pièce”) + 1

Then double click again

i have an error when i do that

row.item(“Date de piece”) is an object, not a datetime. You have to use Parse to turn it into an actual datetime. And what is +1 supposed to do? If you need to add a day or something, use DateAdd.

@postwick

What i need is if the information on column “Date de pièce” row 1 = column “Date de pièce” row 2

+1 means the row after, there is no datetime here, “date de pièce” is the column name

row.item(“Date de piece”)

That just references the object. To get the actual value, add .ToString on the end

row.item(“Date de piece”).ToString

@postwick @Srini84
yes you are right but its not resolving the problem of row+1
i can do this :

if
row.item(“Date de piece”).ToString = row+1.item(“Date de piece”).ToString

yourDT.Rows((yourDT.Rows.IndexOf(CurrentRow)+1))Item(“Date de piece”).ToString

I think that will work. You’re referencing the row by index yourDT.Rows(index) and using the currentrow index and adding 1.

HI @Soudios

Check this solution, maybe it can be used for your use case also

Best regards, Lev