How to get the row index

Hi have two Datatables(DT1,DT2) i need to compare DT1 with DT2 Datatable,after comparison,my requirement is i want Extract DT1 of Row Index and stored it into different datatable(instead of printing),i have tried below code,but getting error,
here index is int

image

give a try on IndexOf instead of Index

Hi @Lakshmi_N

Have a look to the below img :-

image

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

Hi Pratik_Wavhal,

here i want to store this index values to another data table dt3,how to store this values to dt3.

i have tried this code but its always giving 0 index.

image

@Lakshmi_N
Kindly note:

  • dt3.Rows(0)(… will store the index within each loop on dt3 first row into the column Input …
    Was this your intention?

  • Have a look on the for each row output index. Maybe using this will help you on your implmentation

Hi @Lakshmi_N

May i know for what purpose you are using the below assign :-

image

Also what @ppr said is correct. Try it once.

Note :- ForEachRow Activity Index always start with 0.

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer: