Automation in UiPath becomes more efficient when utilizing advanced activities that offer flexibility and control. One such activity is the “Pick Branch” activity. This blog post will guide you through the steps to effectively use Pick Branch activities in UiPath to handle multiple events simultaneously, ensuring your automation is both robust and dynamic.

What is a Pick Branch Activity?

Pick Branch activities in UiPath are used within a Pick activity, allowing you to handle multiple potential actions or events concurrently. Each Pick Branch contains a trigger and an action. When a trigger occurs, the corresponding action is executed, and the remaining branches are ignored. This is particularly useful in scenarios where your workflow needs to respond to various events but only act on the first one that occurs.

Steps to Use Pick Branch Activities

1. Add the Pick Activity to Your Workflow

   – Drag and drop the Pick activity from the Activities panel into your workflow.

image 152

2. Add Pick Branch Activities

   – Within the Pick activity, add a Pick Branch for each potential event or action you want to handle. You can do this by right-clicking on the Pick activity and selecting “Add Pick Branch” or dragging the Pick Branch activity from the Activities panel into the Pick activity.

image 153
image 154

 3. Configure Triggers for Each Pick Branch

   – Each Pick Branch must have a trigger event. Drag an appropriate trigger activity (e.g., Delay, Element Exists, Message Box) into the Trigger section of each Pick Branch.

   – Example: If you’re waiting for a specific element to appear on the screen, use the “Element Exists” activity as the trigger. Say you are trying to log into a platform. 

image 155

4. Define Actions for Each Pick Branch

   – Drag and drop the activities you want to execute when the trigger occurs into the Action section of each Pick Branch.

   – Example: If your trigger is an “Element Exists” activity, the corresponding action could be a series of activities to interact with that element.

image 156

5. Set Trigger Conditions (Optional)

   – For more complex scenarios, you can set conditions for your triggers to ensure they only activate under specific circumstances.

 6. Execute the Workflow

   – When the workflow runs, the Pick activity monitors all defined triggers simultaneously. As soon as one of the triggers occurs, the corresponding action is executed, and the other branches are ignored.

Note*

Prioritize Common Triggers: Ensure the most likely triggers are checked first to optimize performance.

Use Clear and Descriptive Names: Name your Pick Branches and activities clearly to improve readability and maintainability.

Test Thoroughly: Given the nature of concurrent events, test your workflow extensively to ensure all branches work correctly and only one branch is executed per run.

 Conclusion

The Pick Branch activity in UiPath is a powerful tool for managing multiple events in your automation workflows. By following these steps, you can create flexible and efficient automations that respond dynamically to various triggers. Experiment with different scenarios and triggers to fully leverage the capabilities of Pick Branch activities, making your automations more robust and adaptable.

Categorized in:

Tagged in: