studio
2023.4
false
Studio User Guide
Last updated Nov 4, 2024

Example of Using a Break Activity

To exemplify how to use the Break activity we are going to build upon the project created for The For Each Activity. This new project writes only the first iteration of the loop and a few elements of the array to the Output panel.

  1. In the Body of the For Each activity, under the Write Line, add a Break activity.
  2. Under the For Each, add a new Write Line activity.
  3. On the right side of the Text field, select Plusdocs image > Open in Advanced Editor.
  4. Inside the Expression Editor window, type FibonacciNumbers(0).ToString + " " + FibonacciNumbers(2).ToString + " " + FibonacciNumbers(4).ToString + " " + FibonacciNumbers(6).ToString + " " + FibonacciNumbers(8).ToString + " " + FibonacciNumbers(10).ToString + " ". This means that only the indicated elements of the array are going to be written to the Output panel.

    The final project should look as in the following screenshot.



  5. Press F5. The automation is executed. Note that the Output panel only displays the first iteration of the loop and the specified array elements from the Write Line activity.


Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.