Shoji
(Shoji Yamada)
March 21, 2023, 1:21am
1
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
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
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:
Hi All,
Datatable - variable type is the most commonly used variable type by all UiPath users
And it’s been the most often asked queries in forum especially on its manipulation
So I would like to have this post as a repository for those who are looking for expressions related to Datatable
Let’s go one by one keeping dt as name of datatable variable
1. Get number of rows in a datatable dt
dt.Rows.Count (output - int32 type)
2. Get number of columns in a datatable dt
dt.Columns.Count (outp…
Cheers
Steve
Shoji
(Shoji Yamada)
March 21, 2023, 1:31am
3
Yes, this is working if I use it in Write Line Activity, but not working in Display Message Activity
jack.chan
(Jack Chan)
March 21, 2023, 1:32am
4
you can make use of output property to get the current iteration @Shoji
Shoji
(Shoji Yamada)
March 21, 2023, 1:39am
5
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
jack.chan
(Jack Chan)
March 21, 2023, 2:14am
8
@Shoji
try this, it works perfectly for me
Sequence.xaml (10.0 KB)
1 Like
system
(system)
Closed
March 24, 2023, 2:14am
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.