Introduction
This article describes how to use ‘If’ package in Automation Anywhere using community edition. In some circumstances, we need to do actions based on condition so I will explain the same in this article.
If you are a beginner then need to check this article Getting Started Robotic Process Automation using Automation Anywhere to create environment of Automation Anywhere.
Create a New bot
After logging Automation anywhere account through cloud community edition link,

You will see a Dashboard as shown in below image and you can create a new bot through highlighted button ‘create a bot’,

Bot Configuration
After clicking on ‘create a bot’ button, you will get a popup window. It will ask some information about bot which you want to create like-
- Name of bot
- Description of bot(optional)
- Folder location of bot

After clicking on choose option, a popup window will come where you can browse ‘CSharpCorner’ folder and click on choose to set a default location for your new bot.

After creating bot, we will use ‘If’ package to calculate result based on percentage like-
- >=75% : Pass with Distinction
- >=33% and Above to < 75% : Only Pass
- < 33% : Fail
And for this we will follow below steps-
- Create Variables
- Create String Variable(To Store value after getting from user)
- Create Float Variable(To Store value after conversion)
- Add Prompt for value(To get the value from user)
- Convert String Variable To Number variable
- Add If (>=75%) condition and show message ‘Pass with Distinction‘
- Add else If (>=33% and Above to < 75% ) condition and show message ‘Only Pass’
- Show message ‘fail’ message in else
Create Variables
Let’s create variables to store value after getting from user as string and after conversion as float.
Create String Variable
Create a variable through left side variable pane and click on ‘+’ sign, and select ‘String’ type and name as ‘StringVariable’ and click on create button.

Let’s create another variable of ‘Number’ type with name as ‘NumberVariable’

Add Prompt ‘for value’
Let’s go to ‘Action’ pane on left side and find ‘Prompt’ action. Drag & drop ‘for value’ into workspace and fill below details-
- Caption of Prompt Window would be like ‘Get percenatge’
- Prompt Message would be like ‘Please fill your Percentage’
- Select ‘StringVariable’ to get prompt value.

Convert ‘String’ to ‘Number’ Variable
In this step, we will convert ‘StringVariable’ into ‘NumberVariable’ and do so we go to ‘Action’ pane on left side and find ‘String’ action. Drag & drop ‘To Number’ into workspace and select ‘StringVariable’ as string & select ‘NumberVariable’ as ouput.














Join the conversation! Your thoughts help the community grow.