Question

Need for a If condition

  • 28 December 2022
  • 3 replies
  • 241 views

Userlevel 1
Badge +4

Hello,

I need add a conditional logic to my bot so that it continues if there is no data returned from a search within a web application.

Specifically, here is what is occurring:

  1. Search is executed.
  2. If a record is returned, the record will be presented in a row format with a radio button to be selected, as shown below:
  3. If there records returned, the screen will look like this with no radio button to select:

If condition #2 occurs, the bot will click the radio button and the processing for that specific row will continue

If condition #3 occurs, the bot needs to terminate that iteration of the loop and go on to the next search parameter in the loop.

I had my if statement set to if  the data table if blank (as shown in #3) to continue to the next search parameter in the loop, and my if else has the actions necessary to continue processing with the returned record (as shown in #2). However, when the bot encounters no records returned (as shown in #3) the bot stops processing. 

I believe using if/if else condition here is what I need, but I just need some guidance on how to correctly build the if action condition, so that the bot can continue to condition #2 when it encounters condition #3.

Thanks!

Jason Harper 

 


3 replies

Userlevel 6
Badge +15

Hi @harperjg ,

 

Please try the if condition with a recorder options, If object exist or not, ( here, you need to capture the radio button to check the row exist or not). If the object is present you can continue or skip..etc.

if the object not present you can also do the other operation.

 

  • Use the Object exists condition to detect an object in a window. Select a window or variable to capture the object. Enter the amount of time (in seconds) to wait for this condition to be true, that is, for the object to be detected.
  • Use the Object does not exist condition to verify whether a specific object exists in a window, and then based on the result, execute actions. Enter the amount of time (in seconds) to wait for this condition to be true. For example, you can use the Object does not exist condition inside the Loop > While condition to make sure that the bot does not execute the next action until the object on the business application is loaded.

Note:The Object exists and Object does not exist Recorder conditions support Chromium-based Microsoft Edge with Internet Explorer mode

 

https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/aae-client/bot-creator/commands/cloud-if-command.html

 

Thanks!

Userlevel 5
Badge +9

@harperjg ,

Check if the  action IF Recorder (object exist, object does not exist)  can be useful for you

 

HTH

Regards

Userlevel 1
Badge +4

Cool. Thanks! I must have over looked that option in the condition dropdown. 

Reply