Overview

Subject: This tutorial demonstrates how to use Rules Engine to update scorecards on a schedule based on calculated fields.
Scenario: A CSM may want to have Scorecards updated automatically based on Usage Data.
Complexity: Medium/Hard
Description: Leveraging calculated fields and multiple actions, scorecards can be populated within a single rule.
Challenges: Read the "Know Your Data!" section to understand common pitfalls in working with Usage Data and Calculated Fields.
Approach:
  1. Confirm scorecard configuration is Red/Yellow/Green
  2. Create a new scorecard
  3. Create a rule with a calculated field
  4. Create multiple actions to set score levels

Notes and Tips

  • This tutorial is presented for educational purposes only.
  • Always test your rules before running them in a production environment.
  • Understand your Salesforce environment before performing any operations which may affect your data.
  • Know your data to ensure that Usage Data is clean and accurate.

Advice for the New Admin

This tutorial includes several important lessons that help new Admins towards a broader understanding of Rules Engine and, in particular, how to avoid common pitfalls.

  • Use the Correct Time Identifier for Usage Data

Pay close attention to the time identifier when working with Usage Data.

  • In this case use "Date" - this is associated with the actual date for data
  • Do not use "Created Date" - this is the date when SFDC created the record and may not be the same as the "Date" for Usage Data
  • Define Date Ranges with Calculated Fields

While calculated fields are a powerful asset to Rules Engine, a deeper understanding of the functionality is also required. For instance, this tutorial defines:

  • Average of Page Views over the last 4 weeks
  • Maximum of Page Views over the last 3 months

Important: You must define a point in time for the Rules Engine to start from while calculating. Otherwise, it may start from a different point in time than expected, so the rule may seem not to work.

  • Filters should be used to dynamically identify the date range.  Commonly you will define what a week looks like (see below)
  • Once you have bounded a time period (in this case a week, in others it could be more) then it can accurately go back and perform the calculation.
  • For Calculated Fields - Set Usage Data Aggregation Level to "ACCOUNTLEVEL"

For Calculated Fields to function correctly, Usage Data Aggregation Level Must be set to "ACCOUNTLEVEL".  Other options might cause odd results or not work correctly.

Know Your Data!

Inspect your data and ensure that it is in a good state without gaps (for example, NULLs). If your Usage Data is incomplete, refer to Tutorial - Setting Usage Data Metrics to Zero for Period X, to replace NULL or missing values with zero values.

Configure a Scorecard Measure

In this tutorial, the RYG Grading Scheme is used.

To create:

  1. Navigate to Administration > Scorecards 2.0.
  2. In the MEASURES tab, click +MEASURE and create the required 'Pageviews' measure.

Score2.png

  1. Select the SCORECARD tab.
  2. Click +SCORECARD.
  3. Create 'Pageviews Scorecard'.

Score3.png

  1. Configure other parameters.
  2. Click SAVE.

For more information about configuring Scorecards 2.0, refer to Configure Scorecards 2.0.

Set Scores Based on Pageviews (using Rules Engine)

Create New Rule - Set Scores Based on Pageviews

Load Scorecards via RE.png

Create a new rule:

  • Rule Type: Bionic
  • Rule For: Account
  • Rule Name: Set Scores Based on Pageviews
  • Description: <Something denoting intent of the rule>
e13505a5-acb5-4ccd-b5c4-ef57fce5166e.png
  1. In the Show Field add:
    • Account::Id
    • Account::Name
    • Usage Data::Page Views
  2. Add Calculated Field:
    • Click "Add Calculated Field" to create a new field "PCT Page Views 4 WKS"
    • For A: Select AVG of Page Views over the Past 4 Weeks
    • For B: Select MAX of Page Views over the Past 3 Months
    • This will appear in the "Show" field once complete
  3. In Filters:
    • Usage Data::Date / greater or equal / First Day of Previous Week
    • Usage Data::Date / less or equal / Last Day of Previous Week
  4. In Advanced Logic:
    • Make sure the Time Identifier = Date
  5. Click NEXT.

Create New Action - Set Scores Based on Pageviews

Create new actions:

Provide the following details for each of the actions:

  • Scorecards 2.0
  1. Select/Enter:
  • Action Type: Set Score 2.0
  • Select Measure: Pageviews
  • Select Scorecard: Pageviews Scorecard
  • Select Score from: Required field.
  1. Add criteria and additional actions for various ranges of pageviews as defined in the preceding Actions set for Action Type - Set Score.
  2. Click Save.

image.png

Run the Rule

Run the rule in test mode first to understand the results. If the results are as expected, execute the rule.

bf54fadb-cd2a-48fa-b0c5-09d36c6d4191.png

Results

For this tutorial, data is staged for three companies: Yahoo (Green), LinkedIn (Yellow), and Google (Red).

Actions run in a "cascade-like" way.  The most important Actions (highest precedence) should run last.

  1. Yahoo is found in Green as expected
  2. LinkedIn falls into the Yellow category
  3. Google falls into Red
  4. Others that have no page views (but are found in Usage Data) fall out into a secondary Red category
f16c99ae-be9c-469f-9ec5-db5ced5323be.png

View Scorecard in C360

The goal of this tutorial is to view Pageviews measure populated with a score in Customer 360 page for each account.

Scorecards 2.0

ScoreLast.png

End Notes

This tutorial explores the creation of scorecards based on existing Usage Data.

It is important to note that this rule only updates scorecards for Accounts with Usage Data. To produce scorecards for those accounts without Usage Data, you need to leverage the use of SFDC Checkbox fields and introduce additional rules to detect such states.

Examples of using SFDC Checkbox Fields can be found here: