Skip to main content

Performing data handling with the Toolbox

6 Tasks

30 mins

Visible to: All users Applies to: Pega Robotic Automation 22.1
Beginner
Robotic Process Automation
English
Verify the version tags to ensure you are consuming the intended content or, complete the latest version.

Scenario

A Robotic Banking company introduces cashback credit cards for customers that signed up for a Supershop promotion. You are to create an automation that reads Customer IDs from a file that contains all customers who are authorized for a promotion. For each customer, select transactions made for a Supershop. Each transaction results in adding USD10 to the user's saving account. 

Complete the following tasks:

  • Create an automation that reads the IDs of the clients from a text file and saves them in a lookup table. 
  • Create an automation that loops through the customer's list and searches for each customer ID in the BankerInsight application. 
  • Create an automation that searches for all transactions with a description: Supershop and saves the number of such transactions. 
  • Create an automation that includes a USD10 discount to the client's account. 
  • Move all automations concerning the Supershop promotion to a separate folder. 

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Challenge Walkthrough

Detailed Tasks

1 Create a lookup table structure that contains data of all clients that signed up for a Supershop promotion

  1. Download the Robotic Banking project: 
  2. Save the file to your desktop and unzip the file to extract the project folder to your C:\Users\<username>\Documents\Pega Robot Studio\Projects\.
  3. On the Home screen in Pega Robot Studio, click Open Project, and then navigate to the projects folder and open Robotic Banking.pegaproject
    Note: The starter project includes a configured BankerInsight application. The value of the Path field must match the location of BankerInsight on your local computer for the project to function properly. In the BankerInsight application, change the value of the Path to the location of your BankerInsight application.
  4. On the Project Explorer, click Globals to open the Globals designer.
  5. On the Toolbox, in the search field enter Lookup to find a LookupTable component. 
    Lookup table component
  6. Drag the LookupTable component to the Globals table to add it to the project. 
  7. On the property grid, change the Name parameter to SupershoppersTable.
  8. On the property grid, click the More icon on the Fields property to open the LookupField Collection Editor.
    Screenshot showing the LookupTable component property grid.
  9. In the LookupField Collection Editor, click the Add icon to add the following fields to the lookup table:
    FieldName Key Type
    CustomerId true System.String
    First name false System.String
    Last name false System.String
     
    LookupField collection editor
  10. Click OK to close the LookupField Collection Editor.
  11. On the toolbar, click Save to save the changes to the Globals

2 Create the GetSupershopClientList automation

  1. On the toolbar, click Project to return to the Project Explorer.
  2. On the Project Explorer open the GetSupershopClientsList automation.
  3. On the Palette, in the Globals section, drag the SupershoppersTable to the automation surface to display the Select action dialog box. 
  4. In the dialog box, find the ImportDelimitedFile method and add it to the automation. 
    1. In the dialog box, click More to display the properties, methods, and events for the control.
    2. In the search field, enter ImportDelimitedFile.
    3. Click the Method tab.
    4. Select the ImportDelimitedFile method check box.
    5. Click Add to add the property to the design surface. 
  5. On the ImportDelimitedFile method, click the names of parameters to change them to the following values:
    Parameter Value
    filePath C:\Users\<username>\Desktop\RobotStudioChallengeAssets\Supershop_clients.txt
    delimiter Comma
    mappingMethod UseColumnIndex
  6. In the Toolbox tab, in the search field, enter Toast to find a Toast Notification component, and then drag it to the automation surface.
  7. In the message parameter of the Toast Notification component, enter Customer data transferred to lookup table
  8. On the automation surface, connect the links as shown in the following example:
    The GetSupershopClientsList automation with Toast notification for successful import.
  9. On the toolbar, click Save to save the automation.  
  10. Test the automation:
    1. On the automation toolbar, click Test.
    2. In the Testing automation dialog box click Test.
    3. Verify that the toast notification is correctly displayed.
      Screenshot showing the toast notification in the Pega Robot Studio.

3 Create the CustomerSearch automation

  1. On the toolbar, click Project to return to the Project Explorer.
  2. On the Project Explorer, click CustomerSearch to open the automation.
  3. On the Palette tab, in the Globals section, drag the SupershoppersTable to the automation surface to display Select action dialog box.
  4. In the dialog box, find the RowCount property and add it to the automation. 
  5. Add a decision block to check if the Lookup Table contains any entries:
    1. Double-click the automation surface to open the Quick add dialog box.
    2. In the Toolbox section, click Workflow > Decisions.
    3. Double-click the DoesNotEqual component to add it to the automation surface. 
    4. Connect the RowCount property with the decision box to validate the number of entries in the lookup table as shown in the following image.
      SuperShoppersTable rowCount design block connected to a decision block.
    5. On the decision block, insert 0 as a (not set) parameter. 
  6. On the Palette tab, in the Globals section, drag the SupershoppersTable to the automation surface to display the Select action dialog box.
  7. In the Select action dialog box, find the GetKeys method, and then add it to the automation. 
  8. Add a ListLoop to iterate through the Lookup Table entries:
    1. Double-click the automation surface to open the Quick add dialog box.
    2. In the search field of the dialog box, enter ListLoop.
    3. Double-click the ListLoop component to add it to the automation. 
    4. Connect the ListLoop to the GetKeys method, as shown in the following image.
      SuperShoppersTable GetKeys design block connected to the ListLoop component.
  9. Add the BI_ClientSearch automation to the CustomerSearch automation:
    1. On the CustomerSearch automation, click Include to open Include in palette dialog box.
    2. In the dialog box, click the Automation tab.
    3. In the BI_ClientSearch row, click the Add button to add the application to the automation.
    4. Click Done to close the Include in palette window.
  10. On the Palette, in the Automations section, drag the BI_ClientSearch automation to the design surface to open Select action dialog box.
  11. In the dialog box, select Run method then click Add.
  12. On the automation surface, connect the links, as shown in the following image.
    The CustomerSearch automation containing list loop and application method.
  13. On the toolbar, click Save to save the automation.  

4 Create the SearchForTransactions automation

  1. On the toolbar, click Project to return to the Project Explorer.
  2. On the Project Explorer, click SearchForTransactions to open the automation.
  3. Add the BankerInsight application to the SearchForTransactions automation:
    1. On the toolbar, click Include to open Include in palette dialog box.
    2. In the dialog box, click the Application tab.
    3. In the BankerInsight row, click the Add button to add the application to the automation.
    4. Click Done to close the Include in palette window.
  4. On the Palette tab, in the Applications section, click BankerInsight > frmBankerInsight > tabCustomerAccount > tabAccountTypes to expose the transaction table control. 
  5. Drag the dgvAcctTrans control to the automation surface to display the Select action dialog box. 
  6. In the Select Action dialog box, find the Row Count property, and then add it to the automation surface. 
  7. Add a ForLoop to iterate through the user transaction entries:
    1. Double-click the automation surface to open the Quick add dialog box.
    2. In the search field of the dialog box, enter ForLoop.
    3. Double-click the ForLoop component to add it to the automation. 
  8. On the ForLoop design block, right-click on the Limit parameter, and then select Reset Changes, as shown in the following image:
    The Reset Changes option of the ForLoop.
  9. Drag the dgvAcctTrans control to the automation surface to display the Select action dialog box. 
  10. In the Select Action dialog box, find the GetCellValue(int32 row, int32 col) method, and then add it to the automation surface.
  11. In the column parameter, enter 2.
  12. On the Toolbox, in the search field, enter Contains to find a Contains method, and then drag the Contains method to the automation surface. 
  13. In the seekString parameter, enter Supershop.
  14. On the automation surface, connect the links as shown in the following image.
    The initial version of SearchForTransactions automation.
  15. On the toolbar, click Save to save the automation.
  16. Click Project to return to the Project Explorer.
  17. On the Project Explorer, click CustomerSearch to open the automation.
  18. Add the SearchForTransactions automation to the CustomerSearch automation:
    1. On the toolbar, click Include to open Include in palette dialog box.
    2. In the dialog box, click the Automation tab.
    3. In the SearchForTransactions row, click the Add button to add it to the automation.
    4. Click Done to close the Include in palette window.
  19. On the Palette tab, in the Automations section, drag the SearchForTransactions automation to the automation surface.
  20. In the Select action dialog box, find a Run method and add it to the automation. 
  21. On the automation surface, connect the links, as shown in the following image.
  22. On the toolbar, click Save to save the automation.
    The CustomerSearch automation with transactions search part added.

5 Create the AddDiscount automation

  1. On the Project Explorer, click AddDiscount to open the automation.
  2. On the Palette tab, in the Applications section, click BankerInsight > frmBankerInsight > tabCustomerAccount > tabAccountTransactions to expose the add transaction form controls. 
  3. Drag the txtTransAmt control to the automation surface to display the Select action dialog box. 
  4. In the dialog box, find the Text property and add it to the automation:
    1. In the dialog box, click More.
    2. In the search field, enter Text.
    3. Click the Property tab.
    4. Select the Text check box.
    5. Click Add to add the property to the design surface. 
  5. In the Text property, enter 10
  6. Drag the txtTransNotes control to the automation surface to display the Select action dialog box. 
  7. In the dialog box, repeat steps 4a-4e to find the Text property for the txtTransNotes control and add it to the automation.
  8. In the Text property, enter Supershop discount
  9. Drag the btnSubmit control to the automation surface to display the Select action dialog box. 
  10. In the dialog box, repeat steps 4a-4e to find the PerformClick (no parameters) method for the btnSubmit control and add it to the automation.
  11. On the automation surface, connect the links as shown in the following image.
    The AddDiscount automation with all blocks connected.
  12. On the toolbar, click Save to save the automation.
  13. Click Project to return to the Project Explorer.
  14. On the Project Explorer, click SearchForTransactions to open the automation.
  15. In the SearchForTransactions automation, on the toolbar, click Include and add the AddDiscount automation to the Palette. 
  16. On the Palette tab, in the Automations section, drag the AddDiscount to the automation surface.
  17. In the Select action dialog box, find the Run method and add it to the automation. 
  18. On the automation surface, connect the links, as shown in the following image.
    An update to SearchForTransactions automation.
  19. On the toolbar, click Save to save the automation.  

6 Move all automations concerning the Supershop promotion to a separate folder.

  1. On the toolbar, click Project to return to the Project Explorer.
  2. On the Project Explorer, click Add > Folder to display Add new folder dialog.
  3. In the Add new folder dialog, in the Folder name field, enter Supershop.
  4. Click Add to add a new folder to the Project Explorer.
  5. Drag the following automations to the Supershop folder:
    • AddDiscount
    • CustomerSearch
    • GetSupershopClientList
    • SearchForTransactions
  6. Save the project. 

This Challenge is to practice what you learned in the following Module:


Available in the following mission:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice