Iterate each row

It’s hard to say from this screenshot alone.
Clearly, some variable hasn’t been initialised but has been accessed.

Are you able to share the workflow?

CompareData.xaml (39.2 KB)

i have attached my workflow.

I think there are a couple of issues to address here before you can proceed.

  1. Your for loop runs on outDt which is not a collection, but a String object.
    That’s not how a for loop works, you should instead be using the DataTable object - ExtractDatatableRehk
    image
  2. The row variable in your for loop (image 1) is supposed to be the iterator but it’s of type Int32.
    A. It cannot function in its current state because the for loop runs on a String.
    B. It should be a DataRow object which iterates over the DataTable object. Then you can successfully iterate over the table.
  3. To achieve this, use For Each Row activity, not For Each.
    image
  4. Use output property Index to reference the current position in the loop.
    The variable sCurrentIndex will have a value corresponding to the current row being iterated in the table.
    image

If it is necessary, I will strongly recommend revisiting the UiPath academy training on Datatables and selectors to make this process easier for you.

Regards!

Hi,

Thanks for your Recommendation and i really appreciate that.

i follow the academy video, and understood as well and also done what you said to do for iteration in For Each row loop(Changed for each to for each row).

But still not able to achieve it and yes this usecase is important for me.


Please find the error and suggest the solution please.

Thanks