You are on page 1of 8

Automating Tasks Using the Enterprise A2019 Excel Advanced Actions

Measuring Production Line Efficiency: Step List

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

a. Create a task bot


i. First, log in to the Automation Anywhere Community Edition Control Room.
Note: Before you create a new task bot, make sure that you have installed the latest
version of Bot Agent and your device is registered.
ii. To create a task bot:
(a) In the Navigation pane, go to BOTS, click My bots, and then click Create a bot
icon.
(b) Enter a name for the bot and click Create & edit.

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.

f. Create a count variable and convert it to string


i. From the Actions palette, drag and drop the Number: To string action to the canvas
within the Loop action.
ii. From the Variables palette, create a variable count with the variable type as Number
and the Default value as 2.
iii. In the Enter a number field, assign the count variable to it.
iv. In the Enter number of digits after decimal (number format) field, enter the number
of digits after decimal.
v. In the Assign the output to variable field, click the Create variable icon to create and
assign a String variable to the output.

g. Set Value to Standard Allowed Minute (SAM)


i. From the Actions palette, drag and drop the Excel advanced: Set cell formula action
to the canvas within the Loop action.
ii. In the Action details pane, select the Specific cell and specify the column heading
(letter of the alphabet) along with the string count variable.
iii. In the Enter formula for specific cell field, create a string variable with default value
25 and assign it here.
iv. In Session name section, select Local name tab and enter the name as Session1.

h. Calculate the Total Minute Produced and Line Efficiency


i. From the Actions palette, drag and drop the Excel advanced: Set cell formula action
to the canvas within the Loop action.
ii. In the Action details pane, select the Specific cell and specify the column alphabet
along with the string count variable.
iii. Enter the total minute produced formula to set in the Enter formula for specific cell
field. In this case, enter the formula as =E$StrCount$*$SAM$
iv. In Session name section, select Local name tab and enter the name as Session1.

i. Similarly, calculate the Line Efficiency


i. From the Actions palette, drag and drop the Excel advanced: Set cell formula action
to the canvas within the Loop action.
ii. In the Action details pane, select the Specific cell and specify the column alphabet
along with the string count variable.
iii. Enter the line efficiency formula to set in the Enter formula for specific cell field. In
this case, enter the formula as =H$StrCount$/G$StrCount$*100
iv. In Session name section, select Local name tab and enter the name as Session1.

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.

k. Save the Excel workbook


i. From the Actions palette, drag and drop the Excel advanced: Save workbook action
outside the Loop action.
ii. In Session name section, select Local name tab and enter the name as Session1.

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

a. Create a child bot


i. In the My bots page, and then click Create a bot icon.
ii. Enter a name for the bot and click Create & edit.

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.

c. Loop through each row in the Excel worksheet


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 the 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 Shared session tab and assign the SessionVariable.
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.

d. Using the If action to filter the efficiency less than 25


i. From the Actions palette, drag and drop the If action within the Loop action.
ii. Select Number condition from the Number section under the Condition field.
iii. In the Source value field, specify the record variable that contains the Line efficiency.
iv. Select the Less Than (<) condition from the drop-down list.
v. Enter the value as 25 in the Target value field.
vi. From the Actions palette, drag and drop the Data Table: Insert row action within the
If action.
vii. In the Data table name, create and assign a table type variable named Details.
viii. Select first position under the Insert row at index section.
ix. In the Row record name, assign the Record type variable already created from the
drop-down list.

e. Retrieve and update the worksheet for data table


i. From the Actions palette, drag and drop the Excel advanced: Write from data table
action outside the Loop action.
ii. In the Enter data table variable field, assign the Details-table variable.
iii. Select the Specific worksheet radio button and enter the worksheet name.
iv. In the Specify the first cell field, enter the cell address as A2.
v. In Session name section, select Shared session tab and assign the SessionVariable.
vi. From the Actions palette, drag and drop the Excel advanced: Switch to sheet action.
vii. Select the Name radio button and specify the worksheet name as EfficiencySheet.
viii. In Session name section, select Shared session tab and assign the SessionVariable.

f. Convert Excel to pdf and store it in a desired location


i. From the Actions palette, drag and drop the Excel advanced: Convert Excel to PDF to
the canvas.

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.

g. Send an email to the manager for review


i. From the Actions palette, drag and drop the Email: Send action to the canvas.
ii. In the To address field, enter the manager’s email ID.
iii. In the Subject and Message field, update the text as Report.
iv. In the Send email via list, select the application for sending the email.
v. In the Attachment (optional) section, click Desktop file, and enter the file path and
name of the report PDF file.
vi. Click Save and then click Close to close the Child bot.

3. Calculate the business unit allowance


a. Create a child bot
i. In the My bots page, and then click Create a bot icon.
ii. Enter a name for the bot and click Create & edit.

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).

d. 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 the 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 Shared session tab and assign the SessionVariable.
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.

e. Create a count variable and convert it to string


i. From the Actions palette, drag and drop the Number: To string action to the canvas
within the Loop action.
ii. From the Variables palette, create a variable count with the variable type as Number
and the Default value as 2.
iii. In the Enter a number field, assign the count variable to it.
iv. In the Enter number of digits after decimal (number format) field, enter the number
of digits after decimal.
v. In the Assign the output to variable field, click the Create variable icon to create and
assign a String variable to the output.

f. Set the business unit allowance factor


i. From the Actions palette, drag and drop the Excel advanced: Set cell formula action
to the canvas within the Loop action.
ii. In the Action details pane, select the Specific cell and specify the column heading
(letter of the alphabet) along with the string count variable.
iii. In the Enter formula for specific cell field, create a string variable with default value
10000 and assign it here.
iv. In Session name section, select Shared session tab and assign the SessionVariable.

g. Calculate the business unit allowance


i. From the Actions palette, drag and drop the Excel advanced: Set cell formula action
to the canvas within the Loop action.
ii. In the Action details pane, select the Specific cell and specify the column alphabet
along with the string count variable.
iii. Enter the Business unit allowance formula to set in the Enter formula for specific cell
field. In this case, enter the formula as =I$Strcount$*J$Strcount$/100
iv. In Session name section, select Shared session tab and assign the SessionVariable.

h. Increment the count and string count variable


i. From the Actions palette, drag and drop the Number: Increment action within the
Loop action.

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

a. Call the Efficiency_check child bot


i. In the My bots page, click and open the parent bot.
ii. From the Actions palette, drag and drop the Task Bot: Run action at the end.
iii. Select the Control Room file tab under the Task bot to run section and then browse
and select the Efficiency_check child bot.
iv. Select the Set SessionVariable check box under Input values and select the
SessionVariable from the variable list.
v. Similarly, call the Allowance_Calculation child bot.

b. Close the Excel file


i. From the Actions palette, drag and drop the Excel advanced: Close action into the
canvas.
ii. Select the Save changes when closing file check box.
iii. In the Session name section, select Local name tab and enter the session name as
Session1.
iv. Click Save to save all the changes.

Congratulations! You have now successfully created a task bot that:


 Calculates the Total Minutes Produced.
 Calculates the line efficiency.
 Generates a report containing items with a line efficiency value below 25.
 Sends the report to the manager for review.
 Calculates the Business allowance unit.

You might also like