Issue with For Each Loop - Same Data Filling in All UI Elements

@Aditya_Nalawade

As per your screenshot

It is evident that same data is filled for each ui element loop

That is because you have an outer loop which loops through rows…and inner loop will loop through elements…so for each row of outer loop inner ui element loop will tun for all elements…

So if you want each row to be populated in each element…

Then the loop shpuld change a little

Use for each ui element only…currentindex will give you the index which will be 0 ,1, etc for each iteration

Now instead of your outer datatable loop…use the index as your loop counter so dt.rows(currentIndex)("BHS Category").ToString eill give the corresponding row for each ui element…similarly other items too

Hope this helps

Cheers

1 Like