How to increment values each of the time for website extract data table

I want to increment rows and check if there is match on website extarct with my excel data or no but somehow website extract rows are coming in some different sequence numbers .

EX:
Default start is 2 on web extract.
If no 2 on Web Row : then Selector row is = 5
Extra row = 6
If no 3 on Web Row : then Selector row is = 8
Extra row = 9
IF no 4 on Web Row: then Selector row is = 11
Extra row = 12
If no 5 on Web Row : then Selector row is = 14
Extra row = 15
If no 6 on Web Row : then Selector row is = 17
Extra row = 18

I am taking 2 as default value and incrementing 1 row in for each loop. But need to increment that integer value also each of the time.

Can someone help ?

Thanks

I’m not sure what “Extra Row” in your post means? I am going to ignore it, but please let me know if that is incorrect.

uipath doesn’t have a for loop, so I’d use a while loop instead. Here is some pseudo code:

CurrentRow (integer variable) = 2

While CurrentRow < MaxRow (integer variable)
   If selector row = Current Row
      Then break while loop
      Else CurrentRow = CurrentRow + 3
Loop

Do your processing outside of the While loop now that you’ve found which row you need

Would you be able to provide me some example file ?

Extra row means I am getting one extra row on my extract data table after each of the row that I have to look for the values if match or not .
So, that extra row has also row number.
image

Number 2 is giving = 2
Add Description is giving = 3 (this is extra row where I don’t want to look anything for match)
Number 3 checkbox is giving = 5
vice versa
Thanks

@ushu I think you might help me here as you have suggested me some logic for this process and . Can you please help here ?

Hi,

If input number is n, SelectorRow will be n*3-1 and ExtraRow will be n*3
Can you check the following sample?

Regards,

1 Like

Instead of Extract you should try For Each UI Element. Then you don’t have to do all this manual counting.

Can you explain in details please ?

It is giving me error see below.

Also there will be more data or less data also . EX: there will be only 1 line or more than 3,4, lines also.

Would you mind to provide me an example file ? Bit confuse also. How can I use this in my code ?

Also you used for each Enumerable range , So I want to use my extracted data table rows .

Hi,

Can you try to set Int32 at TypeArgument in ForEach?

Regards,

1 Like

@Yoichi yes, now working. Can you provide me some example how should I apply this code in my flow?

I mean how can I iterate through each extracted row or how can i use this in my selector ? I am matching few things in each row so I have more conditions inside loop and I have made dynamic variable for each row.

I have given default row value = 2 , as each first row starting with 2 in the selector.

Thanks

Hi,

If you want to compare your excel data with each items of web page, the following might help you.

Regards,

I’ve tried your solution but it is giving some wrong numbers , IT is giving me correct for the first row but wrong numbers from 2nd rows.

All time it is just giving number 5

Hi,

Did you use expression (idx+2)*3 -1 as the above sample? if idx is zero, result is 5.

Regards,

Hi,

Sorry, I had misunderstanding. Can you try to set int32 type idx at Index property in ForEachRow.

Regards,

1 Like

Ok, Now I got it correct row numbers . But one more question here ,
I have rows like below and I am iterating through each row so how can i use this if row number 17 is match ?

My bot will start to check rows 5,6, 8,9 ,11,12,14,15,17,18 vice versa.

Do I have to increment row numbers after each row checking condition ? or what ?

image

Hi,

Do you mean want to calculate row number of datatable from selector row number? if so, the following will work.

(17+1)/3-2 = 4

Regards,

No, I am trying to say that let’s say I got the first row number 5 for Checkbox 2 . image

Now for next row Description I am getting row number : 8, but it should be 6 ,
image

and for next it will be 8 : checkbox 3 image

so, How Can i get that ?

Hi,

Can you try as the following in ForEachRow?

Regards,

What is this if condition ? I am matching Excel column 1 EX : VAR1 = 50 with Web column 5 (Amount).

By above thing I am not getting correct row.