Count the number of iteration inside For Each Row in Datatable and display it on Display Message

I want to display the number of iteration of the for each row using display message activity, the problem is it’s not displaying properly.

First, I assigned a variable outside For Each Row

count = 0

Inside my For Each Row, I use another assigned activity to increment the count variable

image

Below that, I use Display Message activity and set the message to

count.ToString() + " / " + total.ToString()

The problem is, it only displays “1/3” in each iteration.

I checked it using Write Line and Message Box activity and it’s working properly

image

Hey

To find the current row number (row index) then insert the following expression within a For Each Row:

1 - Insert a display message activity
2 - Insert the following text:
DT.Rows.IndexOf(row).ToString+" / "+DT.Rows.Count.ToString

Update the capital letters DT with your datatable variable.

Take a look here at this post:

Cheers

Steve

Yes, this is working if I use it in Write Line Activity, but not working in Display Message Activity

you can make use of output property to get the current iteration @Shoji

I want to use Display Message Activity to display the number of iteration, but this is not working. I tried it in Write Line and it’s working but not in Display Message

image
image

I am using this

@Shoji

try this, it works perfectly for me
Sequence.xaml (10.0 KB)

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.