Skip to main content

Managing data with Toolbox

6 Tasks

30 mins

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

Scenario

The Robotic Banking company acquires the Pega Finance webpage that offers the Online Bill Pay system. All customer transactions in the Pega Finance system move to the Robot Banking company BankerInsight application for record consolidation. 

The Robotic Banking company offers a discount to Pega Finance customers who have already signed up and created an account in BankerInsight before the system update. The automation adds a 20% discount to all Pega Finance invoices from the acquisition period and assigns the deal to the BankerInsight account.  

Complete the following tasks:

  • Create an automation that finds Pega Finance customers with the account number corresponding to the BankerInsight account.
  • Create an automation that retrieves the invoice data.
  • Compare the invoice data with the discount period.
  • Concatenate invoice memo and invoice ID to use as a transaction description.
  • Create an automation that applies a 20% discount with proper description to the BankerInsight application. 

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 the Finance_CustomerSearch automation.

Create an automation that loops through the Pega Finance customer list and selects the customer of the given account number. The account number is an input parameter of the automation.

  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. In the Project Explorer, click to open the Finance_CustomerSearch automation.
  5. Add the following design blocks to the automation surface: 
    Design block name Actions
    PerformClick method
    1. On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining, and then drag the lnkCustomers control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter PerformClick.
    4. On the Method tab, select the PerformClick (no parameters) method and then click Add.
    WaitForCreate method
    1. On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining, and then drag the tblAccounts control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter WaitForCreate.
    4. On the Method tab, select the WaitForCreate (no parameters) method and then click Add.
    GetClones method
    1. On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining > tblAccounts, and then drag the trAccounts control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter GetClones.
    4. On the Method tab, select the method and then click Add.
    PerformClick method
    1. On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining > tblAccounts > trAccounts, and then drag the lnkAccountName control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter PerformClick.
    4. On the Method tab, select the method PerformClick (no parameters) and then click Add.
    Text property
    1. On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining > tblAccounts > trAccounts, and then drag the tdAccountNum control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter Text.
    4. On the Property tab, select the checkbox for the Text property and then click Add(1).
  6. In the Toolbox search field, enter ListLoop.
  7. Drag the ListLoop component to the automation surface. 
  8. On the Palette, expand the Locals section, and drag the ListLoop to the automation surface.
  9. In the Select action dialog box, click More and in the search field enter Break.
  10. On the Method tab, select Break and then click Add.
  11. On the Palette, expand Locals > Run, and then drag the accountNumber variable to the automation surface.
  12. In the Toolbox, expand the Data handling > Strings > Compare folder and then drag the Equals method to the automation surface. 
    Screenshot showing Compare method from the String Data Handling library.
  13. On the automation surface, add error handling design blocks: 
    Design block name Actions
    Jump To Success
    1. Right-click the automation surface, and then select Jump To > Success.
    Jump To Failure
    1. Right-click the automation surface, and then select Jump To > Failure.
    2. Click msg, and then enter Record not found.
    Jump To Failure
    1. Right-click the automation surface, and then select Jump To > Failure.
    2. Click msg, and then enter Application timeout.
  14. Connect the design blocks as shown in the following figure:
    Screenshot showing full Finance_CustomerSearch automation with data and automation links.
  15. On the toolbar, click Save to save the automation.

2 Create the Finance_GetInvoiceData automation.

Create an automation that selects the customer's invoice, retrieves invoice data (invoice number, date, amount, and memo), and adds it as a Lookup Table record.

  1. In the Project Explorer, click and open Finance_GetInvoiceData automation.
  2. On the Palette, click Applications, and then select Show hidden items
  3. Add the following design blocks to the automation surface: 
    Design block name Action
    WaitForCreate method
    1. On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining > cntrInvoices, and then drag the tblInvoices control to the automation surface.
    2. In the Select action dialog box, click More.
    3. In the search field, enter WaitForCreate.
    4. On the Method tab, select the WaitForCreate (no parameters) method and then click Add.
    GetClones method
    1. On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining > cntrInvoices> tblInvoices, and then drag the trInvoices control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter GetClones.
    4. On the Method tab, select the method and then click Add.
    PerformClick method
    1. On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining > cntrInvoices> tblInvoices > trInvoices and then drag the lnkInvoice control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter PerformClick.
    4. On the Method tab, select the PerformClick (no parameters) method and then click Add.
    Text property
    1. On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining > frmInvoices, and then drag the txtInvoiceNumber control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter Text.
    4. On the Property tab, select the checkbox for Text property and then click Add.
    5. Repeat steps a-d to add text property for the following controls: txtInvoiceDatetxtInvoiceAmounttxtInvoiceMemo
    AddRecord method
    1. On the Palette tab, expand the Globals section and then drag the Invoice Lookup Table to the automation surface.
    2. In the Select action dialog box, click More.
    3. In the search field, enter AddRecord.
    4. On the Method tab, select the method and then click Add.
  4. In the Toolbox search field, enter ListLoop.
  5. Drag the ListLoop component to the automation surface. 
  6. On the Palette, expand Pega Finance > PegaRoboticsTraining > frmInvoices and drag lnkBackToInvoiceList to the automation surface.
  7. In the Select action dialog box, select PerformClick, and then click Add.
  8. On the automation surface, add automation labels and error handling: 
    Design block name Action
    Jump To Success Right-click the automation surface, and then select Jump To > Success.
    Jump To Failure
    1. Right-click the automation surface, and then select Jump To > Failure.
    2. Click msg, and then enter Pega Finance application timeout.
  9. Connect the design blocks as shown in the following figure:
    Screenhot showing data and automation links of the Finance_GetInvoiceData automation.
  10. On the toolbar, click Save to save the automation.

3 Verify the system move date

Create an automation that retrieves the invoice date and compares it with the discount deadline date. The discount deadline is a global variable that determines the invoices needed to proceed.

  1. In the Project Explorer, select and open CompareDate automation
  2. Add the following design blocks to the automation surface: 
    Design block name Action
    GetRecord method
    1. On the Palette tab, under the Globals folder, drag the Invoice lookup table to the automation surface.
    2. In the Select action dialog box, select the GetRecord method, and click Add.
    TryParse method
    1. In the Toolbox, navigate to the Data Handling > Dates Convert folder.
    2. In the Convert folder, drag the TryParse method onto the automation surface. 
      Data handling Date TryParse method in the toolbox
    Compare method
    1. In the Toolbox, expand the Data Handling > Dates > Compare folder.
    2. Drag the Compare method to the automation surface.
      Data handling date compare method in the toolbox
    Value property
    1. In the Palette, expand Globals and drag invoiceNumber variable to the automation surface.
    2. In the Select action window, select Value property and then click Add.
  3. In the Toolbox, expand Variables, and drag the DateTime variable to the automation surface.
  4. Click the DateTime1 design block name and enter discountDeadlineDate.
  5. On the Palette, expand the Locals section and then select discountDeadlineDate.
  6. In the upper-right corner of the Pega Robot Studio, click an arrow to expand the Property Grid.
    Screenshot showing the button that expands the Property Grid in Pega Robot Studio.
  7. On the discountDeadlineDate property grid, click the calendar icon next to the Value property.
  8. Select 06/01/2022 as the discount deadline date.
    Screenshot showing setting the value of global DateTime variable.
  9. On the Palette, expand Locals, right-click discountDeadlineDate , and then select Move to Globals.
    Select Move to globals to make discountDeadlineDate a global variable
  10. In the Pega Robot Studio popup window click Yes, to save changes in the automation and in the Globals section.
  11. On the automation surface, add error handling design blocks: 
    Design block name Action
    Jump To Success Right-click the automation surface, and then select Jump To > Success.
    Jump To Success Right-click the automation surface, and then select Jump To > Success.
    Jump To Failure
    1. Right-click the automation surface, and then select Jump To > Failure.
    2. Click msg, and then enter Get record failure.
    Jump To Failure
    1. Right-click the automation surface, and then select Jump To > Failure.
    2. Click msg, and then enter Invoice date parsing failure.
    Jump To Failure
    1. Right-click the automation surface, and then select Jump To > Failure.
    2. Click msg, and then enter Invoice date is after deadline.
  12. On the automation surface, connect the links, as shown in the following image:
    Screenshot showing the Compare Date automation with all required connections.
  13. On the toolbar, click Save to save the automation.

4 Update the invoice description

Create an automation that concatenates the invoice's number and memo and saves it in a global variable to be used as a bonus transaction description.

  1. In the Project Explorer, click and open the ConcatenateInvoice automation.
  2. Add the following design blocks to the automation surface: 
    Design block name Action
    GetRecord method
    1. On the Palette tab, under the Globals folder, drag the Invoice lookup table to the automation surface.
    2. In the Select action dialog box, select the GetRecord method, and click Add.
    String variable
    1. In the Toolbox, expand the Variables section and drag a String variable to the automation surface.
    2. Click the String1 design block name and enter invoiceMemo.
    Two invoiceNumber Value properties
    1. In the Palette, expand Globals and drag invoiceNumber variable to the automation surface.
    2. In the Select action window, select Value property and then click Add.
    3. Repeat steps a-b to add another invoiceNumber Value property.
    invoiceMemo Value property
    1. In the Palette, expand the Locals section and drag the invoiceMemo value property to the automation surface.
    2. In the Select action window, select Value property and then click Add.
    Length method
    1. In the Toolbox, expand the Data handling > Strings > Status, and drag the Length method to the automation surface.
      String length method in the toolbox
    GreaterThan component
    1. In the Toolbox, expand the Workflow > Decisions section and then drag the GreaterThan component to the automation surface.
      Greater then method from the toolbox
    Concat method
    1. In the Toolbox, in the search box, enter Concat, and then drag the Concat method onto the automation surface. 
      string concat method
  3. In the Toolbox, add another string variable to the automation surface and name it invoiceDesc
  4. On the Palette tab, right-click the invoiceDesc variable, and then select Move to Globals.
  5. On the automation surface, add automation labels and error handling: 
    Design block name Action
    Jump To Success Right-click the automation surface, and then select Jump To > Success.
    Jump To Failure
    1. Right-click the automation surface, and then select Jump To > Failure.
    2. Click msg, and then enter Invoice memo is empty.
    Jump To Failure
    1. Right-click the automation surface, and then select Jump To > Failure.
    2. Click msg, and then enter GetRecord failure.
  6. On the automation surface, connect the links, as shown in the following image:
    Screenshot showing ConcatenateInvoice automation with all required links.
  7. On the toolbar, click Save to save the automation.

 

5 Calculate discount

Create an automation that calculates a bonus of 20% of a customer's invoice amount for a user that signed up for the BankerInsight account.

  1. In the Project Explorer, click and open CalculateInvoiceDicount automation.
  2. Add the following design blocks to the automation surface: 
    Design block name Action
    GetRecord method
    1. On the Palette tab, under the Globals folder, drag the Invoice lookup table to the automation surface.
    2. In the Select action dialog box, select the GetRecord method, and click Add.
    Value property
    1. In the Palette, expand Globals and drag invoiceNumber variable to the automation surface.
    2. In the Select action window, select Value property and then click Add.
    Replace method
    1. In the Toolbox, in the search box, enter Replace, and then drag the Replace method of the string category onto the automation surface.
      string replace
    2. Hard code the oldValue parameter by clicking on it and typing a $ symbol.  Click on the newValue and then click on the automation surface which will hard code the newValue as a blank string.
      Screenshot showing the replace string design block with its parameters.
       
      Screenshot showing Replace method design block.
    dblAmount variable
    1. On the Toolbox, open the Variables folder, and then drag double variable onto the automation surface.
    2. On the design block, click Double1 and change the name of variable to dblAmount.
    TryParse method
    1. Drag the dblAmount variable from the Locals section of the Palette tab onto the automation surface again. 
    2. In the Select action dialog box, click More, enter try in the search box, and then select the TryParse method and click Add.
  3. In the Toolbox, open the Variable folder and drag two double variables onto the automation surface.
  4. Click the Double1 and change the variable name to calculatedAmount.
  5. Click the Double2 and change the variable name to 20PercentDiscount.
  6. On the 20PercentDiscount design block, Click the Value field, and enter 0.2.
    Screenshot showing double variable design block.
  7. In the Toolbox, open the Workflow folder, and then open the Expressions folder.
    numeric expression folder
  8. Drag the NumericExpression component onto the automation surface.
  9. Click inside the NumericExpression block, and then enter a*b.
    Screenshot showing how to insert a numeric expression in Pega Robot Studio.
  10. On the Palette tab, in the Locals section, right-click the calculatedAmount variable, and then select Move to Globals.
  11. On the automation surface, add design blocks for error handling: 
    Design block name Action
    Jump To Success Right-click the automation surface, and then select Jump To > Success.
    Jump To Failure
    1. Right-click the automation surface, and then select Jump To > Failure.
    2. Click msg, and then enter Failed to get invoice data.
    Jump To Failure
    1. Right-click the automation surface, and then select Jump To > Failure.
    2. Click msg, and then enter Failed to parse invoice data.
  12. On the automation surface, connect the links, as shown in the following image:
    Screenshot showing CalculateInvoiceDiscount automation with required data and automation links.
  13. On the toolbar, click Save to save the automation.

6 Create an automation that applies the discount to the BankerInsight application.

Create an automation that logs in to the BankerInsight, searches for the concerning customer account, and then adds the calculated amount and description transaction to the BankerInsight account. The transaction amount and description are global variables that are calculated in the previous steps.

  1. In Project Explorer, click and open AddDiscountToBI automation.
  2. Add the following design blocks to the automation surface: 
    Design block name Actions

    SelectIndex property

    1. In the Palette, expand Applications > BankerInsight > frmBankerInsight and drag tabCustomerAccount control to the automation surface.
    2. In the Select action dialog box, click More.
    3. In the search field, enter SelectedIndex.
    4. On the Property tab, select the property and then click Add.
      Screenshot showing the design block of SelectedIndex property.
    5. On the newly created design block, click the selectedIndex parameter and enter 1.

    Text property

    1. In the Palette, expand Applications > BankerInsight > frmBankerInsight > tabCustomerAccount > tabAccountTransactions and drag txtTransAmt control to the automation surface.
    2. In the Select action dialog box, select pinned Text property and then click Add.

    Text property

    1. In the Palette, expand Applications > BankerInsight > frmBankerInsight > tabCustomerAccount > tabAccountTransactions and drag txtTransNotes control to the automation surface.
    2. In the Select action dialog box, select pinned Text property and then click Add.

    PerformClick method

    1. In the Palette, expand Applications > BankerInsight > frmBankerInsight > tabCustomerAccount > tabAccountTransactions and drag btnSubmit control to the automation surface.
    2. In the Select action dialog box, select pinned PerformClick method and then click Add.
    PerformClick method
    1. In the Palette, expand Applications > BankerInsight > frmBankerInsight > tabCustomerAccount > tabAccountTransactions and drag btnTransClear control to the automation surface.
    2. In the Select action dialog box, select pinned PerformClick method and then click Add.
  3. On the Palette tab, expand the Globals section and add the calculatedAmount variable to the automation surface. 
  4. In the Select action dialog box, select the Value property and then click Add.
  5. On the Palette tab, expand the Globals section and add the invoiceDesc variable to the automation surface. 
  6. In the Select action dialog box, select the Value property and then click Add.
  7. On the automation surface, Right-click the automation surface, and then select Jump To > Success.
  8. Connect the design blocks, as shown in the following figure: 
    Screenshot showing AddDiscountToBI automation with connection and data links.
  9. In the toolbar, click Save to save the automation.

Confirm your work

  1. In the Project Explorer, click and open BillPaySystemDiscount
  2. On the right-upper corner of Pega Robot Studio, click the Test button to run the automation test.
  3. In the Testing automation dialog box, enter 40932 and then click Test.
  4. Wait till automation completes, and a Test complete dialog box will be displayed. 
  5. On the Test complete dialog box, verify that automation ends with a Success status. 
    Screenshot showing a Test compete dialog box with the test status.
  6. On the dialog box, click Done
  7. Display the BankerInsight application. 
  8. Click the Account Types tab.
  9. Verify that new transactions are added in the Transaction History section.
    Screenshot showing account transactions of the BankerInsight automation with new ones added by the automation.

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


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