Professional Documents
Culture Documents
Introduction
This demo will help you to create a task bot that calculates the Total Minutes Produced, Production
line efficiency, generates a report containing items with a line efficiency value below 25, and finally,
calculates the business unit allowance.
Prerequisite
You need access to the Automation Anywhere Community Edition:
https://community.cloud.automationanywhere.digital
1. Calculate the Total Minute Produced and Line Efficiency
b. Open the Excel sheet from the desired location on the device
i. From the Actions palette, drag and drop the Excel advanced: Open action to the
canvas.
ii. In the Action details pane, click Desktop file and enter the file path with name.
Note: At all such instances, you will have the option to either enter the file path
manually or browse and select the required file. You can choose either of the two.
iii. Select the Specific sheet name field and enter the worksheet name.
iv. Open the file in a read-write mode.
v. In the Session name field, enter a session name. In this case, use Session1.
Note: The session name is case sensitive.
c. Get the number of rows in the Excel sheet and store it into a variable
i. From the Actions palette, drag and drop the Excel advanced: Get number of rows
action below the Open action.
ii. Select Index under the Select worksheet by section and enter the Index as 1.
iii. Select the Non-empty rows radio button.
iv. In Session name section, select Local name tab and enter the name as Session1.
v. In the Assign to variable field, click the Create variable icon to create and assign a
Number variable to the output.
d. Insert a column in the Excel sheet and set the column name
i. From the Actions palette, drag and drop the Excel advanced: Insert/Delete
rows/columns action.
ii. Select the Column operations radio button and specify the location where you want
to insert the column in the field. In this case, enter H.
iii. In Session name section, select Local name tab and enter the name as Session1.
iv. From the Actions palette, drag and drop Excel advanced: Set cell action to the canvas.
v. In the Action details pane, select the Specific cell and specify the cell address as H1
where you want to place the column title.
vi. Enter the column name to set in the Cell value field. In this case, enter Total Minutes
Produced (F=C*D).
vii. In Session name section, select Local name tab and enter the name as Session1.
viii. Similarly, insert a column I in the Excel sheet and set the column name for Line
Efficiency as Line Efficiency (%) (Eff% G=F/E*100).
1
e. Loop through each row in the Excel sheet
i. From the Actions palette, drag and drop the Loop action to the canvas.
ii. In the Iterator list, select For each row in worksheet under Excel advanced section.
iii. In the Loop through field, select the Specific rows option from the drop-down list.
iv. In the From row value field, enter the value as 2.
v. In the to row value field, use the Insert variable icon to select the total number of
rows-number variable.
vi. In Session name section, select Local name tab and enter the name as Session1.
vii. In the Assign the current value to this variable field, click the Create variable icon to
create and assign a Record variable to the output.
2
j. Increment the count and string count variable
i. From the Actions palette, drag and drop the Number: Increment action within the
Loop action.
ii. In the Enter number field, use the count variable.
iii. In the Enter increment value field, enter the increment value as 1.
iv. In the Assign the output to variable field, specify the same count variable to the
output.
v. From the Actions palette, drag and drop the Number: To string action within the loop
action.
vi. In the Enter a number field, assign the count variable to it.
vii. In the Enter number of digits after decimal (number format) field, enter the number
of digits after decimal.
viii. In the Assign the output to variable field, assign the string count variable.
l. Create a Session variable to provide data communication between child and parent bot
i. From the Actions palette, drag and drop the Excel advanced: Set session variable
action to the canvas.
ii. In Session name field, enter the name as Session1.
iii. In the Save session to a variable field, click Create variable icon to create and assign a
Session type variable with Session type as MS Excel session to the output.
iv. Click Save to save the bot and then click Close to close the parent bot.
2. Create a child bot to filter the line efficiency value less than 25, and send out a PDF
report to the management
b. Get the number of rows in the Excel sheet and store it into a variable
i. From the Actions palette, drag and drop the Excel advanced: Get number of rows
action below the Open action.
ii. Select Index under the Select worksheet by section. In this case, enter 1.
iii. Select the Non-empty rows radio button.
iv. From the Variables palette, create a Session type variable with the same name used in
the parent bot. Set the session type as MS Excel Session and select the Use as input
check box.
3
v. In Session name section, select the Shared session tab, click Insert a value icon and
select the Session variable from the drop-down list. In this case, select
SessionVariable.
vi. In the Assign to variable field, click the Create variable icon to create and assign a
Number variable to the output.
4
ii. In the Action details pane, specify whether you want to convert the Entire Excel file,
Active sheet, or Specific sheet to a PDF file. In this case, select Specific sheet and
enter the worksheet name.
iii. Enter a name for the PDF file in the Select PDF file name field.
iv. Specify the location where you want to save the file in the Select PDF storage location
field.
v. In Session name section, select Shared session tab and assign the SessionVariable.
b. Get the number of rows in the Excel sheet and store it into a variable
i. From the Actions palette, drag and drop the Excel advanced: Get number of rows
action below the Open action.
ii. Select Index under the Select worksheet by section and enter the Index as 1.
iii. Select the Non-empty rows radio button.
iv. From the Variables palette, create a Session type variable with the same name used in
the parent bot. Set the session type as MS Excel Session and select the Use as input
check box.
v. In Session name section, select the Shared session tab, click Insert a value icon and
select the Session type variable from the drop-down list. In this case, select
SessionVariable.
vi. In the Assign to variable field, click the Create variable icon to create and assign a
Number variable to the output.
c. Insert a column in the Excel sheet and set the column name
i. From the Actions palette, drag and drop the Excel advanced: Insert/Delete
rows/columns action.
ii. Select the Column operations radio button and in Specific cell field enter the cell
address as J.
iii. In Session name section, select Shared session tab and assign the SessionVariable.
iv. From the Actions palette, drag and drop Excel advanced: Set cell action to the canvas.
v. In the Action details pane, select the Specific cell and specify the cell address as J1
where you want to place the column title.
vi. Enter the column name to set in the Cell value field. In this case, Business Unit
Allowance Factor (H).
5
vii. In Session name section, select Shared session tab and assign the SessionVariable.
viii. Similarly, insert a column K in the Excel sheet and set the column name for Business
unit allowance as Business Unit Allowance (I=G*H/100).
6
ii. In the Enter number field, use the count variable.
iii. In the Enter increment value field, enter the increment value as 1.
iv. In the Assign the output to variable field, specify the same count variable to the
output.
v. From the Actions palette, drag and drop the Number: To string action within the Loop
action.
vi. In the Enter a number field, assign the count variable to it.
vii. In the Enter number of digits after decimal (number format) field, enter the number
of digits after decimal.
viii. In the Assign the output to variable field, assign the string count variable.
ix. Click Save and then click Close to close the child bot.
4. Call the child bots within the parent bot and close the Excel workbook