If Else Command in Automation Anywhere

Explanation of If/Else Command in the Workbench Command Library


An important aspect of recording a task is being able to determine if a condition is true or false and then perform specific
actions depending upon the outcome of the condition test.

For this reason, Automation Anywhere provides one of the most powerful conditional statement the if else command.

The If/else command can be used to perform actions when certain conditions exist.
It allows you to specify how long to wait for the condition to be true before taking another action.

If/Else Command provides a list of sub-commands.

Use File exists and File doesn't exist sub-commands, when you want to perform an action based on whether a file exists.

Use Folder exists and Folder doesn't exist sub-commands, when you want to perform an action based on whether a folder exists.

You can use windows exists and windows doesn't exists sub-command to check or verify that a specific application is open,
to check whether an error has been occurred, or to check whether a file download has completed.

Use application running and application not running sub-commands to perform an action based on whether an application
is running. When a program is running in the background, you can still perform actions by using this command.

Use script successful and unsuccessful sub commands to integrate third party scripts such as VB script and java script with your
automation task bot or meta bot logic. After the script runs and issues a return code, Automation Anywhere can determine if the
script ran successfully. For scripts that you have already developed, you can use this command to integrate them with your
automation task bot or meta bot logic.

Use Task successful and task unsuccessful commands to run several Automation Anywhere task bot or meta bot logics, one after another.

This command runs the selected task bot or meta bot logic, and depending on the return code, determines if it ran successfully
and takes appropriate actions based on the result.


Use Ping successful and ping unsuccessful sub-commands to check whether a machine or server is running, and to take appropriate
actions based on the result.

This variable command is perhaps the most powerful conditional command. Use this command to perform hundreds of checks.

For example:
You can copy data from an application or website and verify that the data you copied matches a specific text string.
You can also verify a numeric string, or check to see if it is greater than or less than a variable or a fixed value.

Use file size command to check whether a file is larger, smaller, or the size you have specified.


Use file date command to check the date and time that a file was created or last modified.
You can specify a date range using between or before keywords.
You can also specify a range using a number of days or a time schedule in the hours,minutes,seconds format.

Use Web Control Command to identify whether a specific web control exists on a web page.
Use this command when editing task bot logics that are created using the web Recorder.

Use Service Running and Service not running sub commands to check whether a particular service is running.

Use Image Recognition Command to check whether an image exists within another image.
Automation Anywhere can recognize images that are stored in files or captured from a window when the task bot
or meta bot logic runs.

You can even specify a minimum 'percentage match' for the image captured.

Image recognition command also provides a powerful tool that enables you to perform click actions on the captured image,
if it is found within the larger image.

Use Windows control command to check whether a specific control exists in an active window.

For Example:
You might check for command buttons, list box items,text boxes or menu tabs.

Note:- I will be updating this blog frequently.✍

Thank you for visiting this blog☕️

“Every morning we are born again. What we do today is what matters most”




To Learn Mainframe Modules (Cobol, Jcl, VSAM, DB2, CICS): Click here

For Latest Job Updates: Click here

For Online Shopping: Click here

You Might Also Like

0 Comments