studio
2021.10
false
UiPath logo, featuring letters U and I in white
OUT OF SUPPORT
Studio User Guide
Last updated Nov 18, 2024

Flowcharts

Flowcharts can be used in a variety of settings, from large jobs to small projects that you can reuse in other projects.

The most important aspect of flowcharts is that, unlike sequences, they present multiple branching logical operators, that enable you to create complex business processes and connect activities in multiple ways.

Flowcharts come with the Auto Arrange option in the context menu.

Example of a Flowchart

To exemplify the properties of a flowchart, we are going to build a guessing game that generates a random number from 1 to 999 that the user must guess. To create such an automation, do the following:

  1. Create a blank process and from the Design tab, in the File group, select New > Flowchart. The New Flowchart window is displayed.
    Note: You can also add a Flowchart activity to the Designer panel to create a new flowchart project.
  2. In the Name field type a name for the automation, such as "First Flowchart", and leave the default project location or add a subfolder. Click Create. The Designer panel is updated accordingly.
  3. Create two Int32 variables (RandomNumber, GuessNumber) and a String one (Message).
  4. Set the default value of the Message variable to "Guess a number from 1 to 999." The RandomNumber stores a random number between 1 and 999, GuessNumber stores the user’s guess and Message stores the message that is going to be displayed to prompt the user.


  5. Add an Assign activity to the Designer panel, and connect it to the Start node.
  6. In the Properties panel, in the To field add the RandomNumber variable.
  7. In the Value field, type new Random().Next(1,999).
    Note: This field uses the Random() function to generate a random number between 1 and 999. For more information on variables, see Variables.
  8. Add an Input Dialog activity to the Designer panel and connect it to the Assign one.
  9. In the Properties panel, in the Label field, add the Message variable.
  10. In the Result field, add the GuessNumber variable. This activity asks and stores the user’s guesses in the GuessNumber variable.
  11. Add a Flow Decision activity and connect it to the Input Dialog. This activity enables you to tell the user if he correctly guessed the number or not.
  12. In the Properties panel, in the Condition field, type GuessNumber = RandomNumber. This enables you to verify if the number added by the user is the same as the randomly-generated one.
  13. Add a Message Box activity and connect it to the True branch of the Flow Decision.
  14. In the Properties panel, in the Text field, type "Congratulations! You guessed correctly! The number was " + RandomNumber.ToString + ".". This is the message that is going to be displayed if the user correctly guessed the number.
  15. Add a new Flow Decision activity and connect it to the False branch of the previously added Flow Decision.
  16. In the Properties panel, in the Condition field, type GuessNumber > RandomNumber. This activity enables you to check if the number the user added is bigger than the randomly-generated one.
  17. In the DisplayName field, type Comparison. This enables you to easily to tell the difference between the two Flow Decisions used.
  18. Add an Assign activity and connect it to the True branch of the Comparison activity.
  19. In the To field, type the Message variable, and in the Value field, type a message indicating that the guess was too high, such as "Too big. Try again.".
  20. Select the Assign activity and press Ctrl+C. The entire activity and its properties are copied to the Clipboard.
  21. Press Ctrl + V. A duplicate of the previous Assign activity is displayed.
  22. Connect it to the False branch of the Comparison activity and, in the Properties panel, in the Value field, type "Too small. Try again.".
  23. Connect the Assign activities created at steps 18-22 to the Input Dialog. A loop is created, asking the user to type a smaller or bigger number, until he guesses correctly.

    The final project should look as in the screenshot below.



  • Example of a Flowchart

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.