Introduction
This article describes how to work with Number package in Automation Anywhere using community edition. We use numbers in every calculation part of any bot so we use number package and we will look the same in this article.
Now, we need to create bot to explain use of number package. 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, you need to create a variable to save outcome of text file.
Create Number Variable
Let’s create a variable through left side variable pane and click on ‘+’ sign, select ‘Number’ type and name as ‘NumberVariable’ and click on create button.
There are couples of sub actions of ‘Number’ action-
- Assign
- Decrement
- Increment
- Random
- To string
Assign
Now Go to ‘Action’ pane on left side and find ‘Number’ section. Drag & drop ‘Assign’ into workspace. Follow the below steps
- Fill source number as 40.
- Select ‘NumberVariable’ to assign value
Message Box to show Number Variable
Go to ‘Action’ pane on left side and find ‘Message box’ section. Drag & drop ‘Message box’ into workspace to display Number variable. You need to just
- Add title name as ‘Show Assigned Number’
- Fill ‘NumberVariable’ in message to display. (with conversion into string and I will explain it later)
Where output with number 40, will look like after running the bot.
Decrement
Now Go to ‘Action’ pane on left side and find ‘Number’ section. Drag & drop ‘Decrement’ into workspace. Follow the below steps
- Enter number as ‘NumberVariable’.
- Enter decrement value as 10.
- Select ‘NumberVariable’ to assign value
Add Messagebox action same as we created earlier, and run it where output with number 30 after 10 decrements from 40, will look like after running the bot.
Increment
Now Go to ‘Action’ pane on left side and find ‘Number’ section. Drag & drop ‘Increment’ into workspace. Follow the below steps
- Enter number as ‘NumberVariable’.
- Enter increment value as 15.
- Select ‘NumberVariable’ to assign value
Add Messagebox action same as we created earlier, and run it where output with number 45 after 15 increments in 30, will look like after running the bot.
Random
Now Go to ‘Action’ pane on left side and find ‘Number’ section. Drag & drop ‘Random’ into workspace. Follow the below steps
- Enter beginning range like 10’.
- Enter end Range like 20.(Randon function will pick any number from 10 to 20)
- Select ‘NumberVariable’ to assign value
Add Messagebox action same as we created earlier, and run it where random output will look like after running the bot.
To string
Create String Variable
Let’s 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.
Now Go to ‘Action’ pane on left side and find ‘Number’ section. Drag & drop ‘To string’ into workspace. Follow the below steps
- Select ‘NumberVariable’ to convert in string.
- Enter number of digits after decimal will be 0 as deafult
- Select ‘StringVariable’ to assign value
Message Box to show string Variable: Go to ‘Action’ pane on left side and find ‘Message box’ section. Drag & drop ‘Message box’ into workspace to display string variable. You need to just
- Add title name as ‘Show Assigned String Value’
- Fill ‘StringVariable’ in message to display
Add Messagebox action same as we created earlier, and run it where random output, will look like after running the bot.
Conclusion
In this article, how to work with Number package in environment of Automation Anywhere.