Skip to main content

Automating actions when a property value changes


3 Tasks

15 mins

Visible to: All users
Intermediate Pega Platform 8.5 Dev/Designer Studio English
This content is now archived and is no longer updated. Progress is not calculated. Pega Cloud instances are disabled, and badges are no longer awarded. Click here to continue your progress in the latest version.


The Payroll Department at TGB reports that some employees enter an incorrect bank name when enrolling in direct deposit. The payroll department requests that the bank name populate based on the routing number entered, to avoid errors in Payroll setup cases.

The following table provides the credentials you need to complete the challenge.

Role User name Password
Senior System Architect SSA@TGB rules
Note: Your practice environment may support the completion of multiple challenges. As a result, the configuration shown in the challenge walkthrough may not match your environment exactly.

Challenge Walkthrough

Detailed Tasks

1 Update the Bank information section

  1. In Dev Studio, search for and open the section rule ProvideBankInformation_0.
    Tip: You can use the Search feature or the Records Explorer to locate the section rule. In the Records Explorer, use the filter option to locate the rule of interest.
  2. Double-click the embedded section to open the Cell Properties dialog box.
  3. Open the section rule BankInformation.
  4. Double-click the Bank name field to open the Cell Properties dialog box.
    Bank information section with the Bank name field highlighted
  5. On the Presentation tab, in the Edit options list, select Read-only (always).
  6. In the dialog box, click Submit to apply the changes.
  7. Double-click the Routing number field to open the Cell Properties dialog box.
  8. On the Actions tab, for Actions type, select Standard.
  9. Click Create an action set to add an action set to the field.
  10. Click Add an event > Change to add a change event to the control.
  11. Click Add an action > Display: Refresh to add a Refresh-This section action to the field. This allows the updated bank name to be displayed to the user immediately when they modify a routing number on the section.
  12. Click Submit to apply the changes. The section resembles the following image.
    Bank information section
  13. Save the section rule.

2 Create the declare on change and activity rules

  1. In Dev Studio, open the Records Explorer.
  2. In the Records Explorer, click Decision > Declare OnChange to open the list of current OnChange triggers in the application.
  3. Click Create to create a new Declare OnChange rule.
  4. Save the new Declare OnChange rule as UpdateBankName.
  5. Ensure that the value of the Apply to field is TGB-HRApps-Work-PayrollSetup.
  6. In the Properties To Watch field, enter or select.RoutingNumber as the property to watch for changes.
  7. In the When field, enter or select Always to run the specified activity every time the routing number changes.
  8. In the When True Run section, enter the activity name UpdateBankName.
  9. Next to the activity name, click the open icon to open the Create Activity form.
  10. Click Create and open to save the new activity rule as UpdateBankName.
  11. On the Security tab of the activity rule, change the Activity type to Onchange.
  12. Configure the activity as described below. The activity removes the previous Bank name value before setting the value again in case the user enters an invalid routing number in the Routing number field.
    When Condition Method Property Name Property Value
    None Property-Remove .BankName  

    if true: Continue Whens
    if false: Skip Step

    Property-Set .BankName "HSBC Bank USA"
    if true: Continue Whens
    if false: Skip Step
    Property-Set .BankName "Ally Bank"
    if true: Continue Whens
    if false: Skip Step
    Property-Set .BankName "Sun Trust Bank"
    Note: The routing number is used to identify the financial institution with which the account was opened. For more information about routing numbers, see
  13. Save the activity rule UpdateBankName and close it.
  14. Save the Declare OnChange rule UpdateBankName and close it.

3 Confirm your work

  1. In the User portal, create a new Payroll Setup case.
  2. Advance the case to the Provide bank information step.
  3. In the Routing number field, enter 021001088 and verify that the Bank name field automatically updates to HSBC Bank USA.
  4. In the Routing number field, enter 124003116 and verify that the Bank name field automatically updates to Ally Bank.
  5. In the Routing number field, enter 061000104 and verify that the Bank name field automatically updates to Sun Trust Bank.
  6. In the Routing number field, enter 123107613 and verify that the Bank name field automatically updates to -- (blank).

Available in the following mission:

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