Skip activities in the same sequence

I’m creating a robot to enter data from an Excel file into an application.
In one of the fields if the data is not correct an Error message would appear. I would like to know how I can skip the rest of activities in the same sequence if the error is shown and continue the workflow.

I want it so that if the error appears it would just stop trying to enter data into the field read in the next row of data and enter it into the application.

I was planning on using the Element Exist activity to check for the error message that pops up and an if statement to skip if the message appears.

Surround that specific activity or sequence of activities in a try-catch. If it encounters an error it will catch it, perform any activities you have in the catch portion, then continue onto the next activity in your workflow outside of that try-catch

1 Like

It still continues to run the other activities that follow after the try catch. What I have is a sequence of activities together inside an attach window activity in my flow chart. What happens is when I try to enter some data into a field that is incorrect the application displays an error message. If the error message appears I want to close the message and skip the rest of the activities in the Attach window activities from running and go into the next activity in the flow chart

If the app error causes your sequence to crash with the same error, you can use the try-catch idea from Dave, just surround the contents of the sequence inside the loop. If it errors out, it skips the rest of the activities. You could also, use this to catch the window error and then use the catch sequence to close the error window, etc.

Or if you know when in the process the error will appear (like after entering the number and enter or whatever), then you can look for the error message and if exists, close it and if it does not exist continue on with the process (use an if to separate paths)

I tried using the try-catch like Dave suggested but it still continues to run the rest of activities in the try. I’m using the element exist to search for the error window that appears in the catch.

Was trying not to not use another flow decision to reduce the amount of processes but I may have to.

I do not think element exists returns an error if the element is not found, but a boolean. So the try catch would not be triggered.

Which activity should I use then?

For the sake of less confusion, I am going to refer to the App error as an “Alert”.
None. You set your process to work as if no alert message occurs When the alert happens, does it cause the bot to crash? If so, then the try catch will work. You can set the catch to the exact alert based on a test run or you can do any exception.

Conversely, If the bot continues to work even if the alert has occurred, then you may need to look for the item before proceeding. If this is the case, then you probably want to use IF on element exists result. If exist do steps to exit, if does not exist rest of activities in loop.

1 Like

The bot would continue to work even if the alert occurs.

Is there a way to exit the sequence if the element is found?

Here is the gist, the if statement is inside the loop. if element exist is tru, then close alert. If element does not exist, then do the rest of the stuff

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.