top of page

How to track the number of pages you processed in UiPath workflow?

Updated: Feb 16, 2023

Many business processes share the requirement for automation to download data from numerous sites within an application. Obtaining deposited check images for financial reconciliation, as an example. The deposit date you are processing has more than one page of checks to download and reconcile, however there is a restriction of 5 deposit transactions per page, and you do not want to process more than a particular number of pages at once. In this situation, the advice given below will be helpful in making sure that you don't overwhelm your team with output and stop at no more than 4 pages for each automation run.


Photo by Scott Graham on Unsplash

To track the number of pages processed in a UiPath workflow and stop processing after 4 pages (20 deposit transactions), you can use a variable to keep count of the number of pages and use a decision structure like "If" to check the value of the variable and stop the workflow if the limit is reached. Here is an example:

  1. Create a variable named "pageCounter" with an initial value of 0.

  2. Increase the value of "pageCounter" by 1 after processing each page. You can do this using an "Assign" activity and setting the value of "pageCounter" to "pageCounter + 1".

  3. After processing each page, add an "If" activity to check the value of "pageCounter". If the value is greater than or equal to 4, use a "Break" activity to stop the loop and exit the workflow.

Here is a sample code in UiPath to implement this:

vbnetCopy code
    'Declare a variable to keep track of the number of pages processedDim pageCounter As Integer = 0'Process each pageFor Each page As Page In pages
        'Process the current page'Increment the page counter
        pageCounter = pageCounter + 1'Check if 4 pages have already been processedIf pageCounter >= 4 Then'Break the loop if the limit has been reachedExit ForEnd IfNext

Note that this code is written in Visual Basic for Applications (VBA) syntax, which is commonly used in UiPath workflows.


4 views0 comments

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page