Build a bot that uses multiple Open and Close Analyze actions in a task to analyze and compare the sales data for each quarter of XYZ Company, and create visualizations in Bot Insight.

Prerequisites

Before you start building the bot, create the following data set on your desktop in the .csv file format.

Procedure

  1. Create a bot.
    1. Log in to the Control Room as a Bot Creator.
    2. On the left pane, click Automation.
      A list of available bots and forms is displayed.
    3. Click Create new > Bot.
    4. Click Create and edit.
  2. Open the XYZ sales data.csv file that you created.
    1. Double-click or drag the CSV/TXT > Open action.
    2. In the Session name field, enter Session 1.
    3. Provide the file path to XYZ company sales data.csv.
    4. Select the Contains header option to exclude the first row.
  3. Create a Record variable as Row by using the Create variable icon.
    The Record variable holds all the values for one row. With each iteration of the loop, the bot retrieves the values of the next row and stores them in the Record variable, overwriting the values from the previous row.
  4. To retrieve the values in the cells from each row in the XYZ company sales data.csv file, use a Loop action.
    1. Select For each row in CSV/TXT iterator.
    2. In the Session name field, enter Session 1.
    3. In the Assign the current row to this variable field, select the Row variable that you created.
  5. Create the following variables for four quarters by using the Create variable icon at the top of the Variables menu.
    • PRODUCTCODE
    • PRODUCTLINE
    • COUNTRY
    • QUANTITYORDERED_QTR1
    • SALES_QTR1
    • QUANTITYORDERED_QTR2
    • SALES_QTR2
    • QUANTITYORDERED_QTR3
    • SALES_QTR3
    • QUANTITYORDERED_QTR4
    • SALES_QTR4
  6. Specify the data to populate on the Bot Insight business dashboard.
    1. Double-click or drag the Analyze > Open action.
      Note: Ensure that you insert the Analyze Open and Close actions inside the Loop action to analyze and capture the data from each row in the Bot Insight dashboard.
    2. Double-click or drag the String > Assign action.
      Press F2 to open the variables menu.
    3. Choose the Row variable from the drop-down list.
    4. Enter PRODUCTCODE and click Yes, insert.
    5. In the Select destination string variable field, choose the PRODUCTCODE variable.
      To assign string variables for PRODUCTLINE and COUNTRY, repeat Step 6b through Step 6e.
    6. Double-click or drag the Number > Assign action.
      Press F2 to open the variables menu.
    7. Choose the row variable from the drop-down list.
    8. Enter QUANTITYORDERED_QTR1 and click Yes, insert.
    9. In the Select destination string variable field, choose the QUANTITYORDERED_QTR1 variable.
      To assign number variables for SALES_QTR1, QUANTITYORDERED_QTR2, SALES_QTR2, QUANTITYORDERED_QTR3, SALES_QTR3, QUANTITYORDERED_QTR4, and SALES_QTR4, repeat Step 6f through Step 6i.
    10. Double-click or drag the Analyze > Close action.
    11. Enter the Transaction name as Quarters 1 and 2.
    12. Select the following transactional variables in the Close action:
      • PRODUCTCODE
      • PRODUCTLINE
      • COUNTRY
      • QUANTITYORDERED_QTR1
      • SALES_QTR1
      • QUANTITYORDERED_QTR2
      • SALES_QTR2
    13. Double-click or drag the Analyze > Open action.
    14. Double-click or drag the Analyze > Close action.
    15. Enter the Transaction name as Quarters 3 and 4.
    16. Select the following transactional variables in the Close action:
      • PRODUCTCODE
      • PRODUCTLINE
      • COUNTRY
      • QUANTITYORDERED_QTR3
      • SALES_QTR3
      • QUANTITYORDERED_QTR4
      • SALES_QTR4
  7. Click Save and then Run.
  8. Click Analyze Task Bot.

    The Bot Insight business dashboard appears.

  9. Select the Preview option.
    The sales data is displayed as follows:

    Data for quarters 1 and 2

    Data for quarters 3 and 4