Tutorial Overview

Subject: This tutorial demonstrates how the Rules Engine may be used to update scorecards on a scheduled basis based on calculated fields.
Scenario: A CSM may want to have Scorecards updated automatically. While SmartSigns may be an option in some cases, the CSM wants to define specific criteria (e.g. "buckets") that define Red/Yellow/Green states.
Complexity: Medium/Hard
Description: Leveraging calculated fields and multiple actions scorecards can be populated within a single rule.
Challenges: Read the "Lessons Learned" section to understand common pitfalls in working with Usage Data and Calculated Fields.
  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

Advice for the New Admin

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

#1 - Use the Correct Time Identifier for Usage Data

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

  • In this case we should use "Date" - This is associated with the actual date for data
  • We should 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

#2 - Define Date Ranges with Calculated Fields

While calculated fields are a powerful asset to the Rules Engine, they also require deeper understanding of how they function.

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 when doing calculations. Otherwise, it may start from a different point in time than expected, so the rule may appear 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.

#3 - 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 may produce odd results or not work correctly.

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.
  • IMPORTANT:  Know your data to ensure that Usage Data is clean and accurate.

Step 1 - Know Your Data!

Inspect your data and ensure that it is in a good state and without gaps (for example, NULLs). If your Usage Data is incomplete, reference the following tutorial for how to replace NULL or missing values with zero values:

Tutorial - Setting Usage Data Metrics to Zero for Period X

Step 2 - Scorecard Setup

For this tutorial, it is recommended to use the RYG Grading Scheme.

Create New Scorecard

Navigate to the Administration > Account Scorecard.

Create a new Objective VitalSigns Scorecard and name it Pageviews (see above), and select Automated as the Type.

Step 3 - Set Scores Based on Pageviews

Create New Rule - Set Scores Based on Pageviews

Create a new rule:

  • Rule Type:  Custom
  • Rule For: Account
  • Rule Name: Set Scores Based on Pageviews
  • Description: <Something denoting intent of the rule>
  1. In the Show Field Select:
    • Account::Id
    • Account::Name
    • Usage Data::Page Views
  2. Add Calculated Field:
    • Click "Add Calculated Field" to create a new field called "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 a new action:

Each of these will have these common elements:

  • Action Type:  Set Score
  • Select Measure:  Pageviews
  • Set Score from:  Scoring Scheme

Specific Criteria for each rule:

  1. Green:  Page Views at or above 75%, Criteria:  PCT Page Views 4 WKS / greater or equal / value / -25
  2. Yellow:  Page Views between 50-75%  Criteria:  
    • PCT Page Views 4 WKS / less than / value / -25
    • PCT Page Views 4 WKS / greater or equal / value / -50
  3. Red:  Page Views below 50%, Criteria:  PCT Page Views 4 WKS / less than / value / -50
  4. Red:  Page Views are 0%, Criteria:  PCT Page Views 4 WKS / equals / value / 999999

The more important actions should always come at the end of the list.  

Click Save.

Run the Rule

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


For this tutorial, data was 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

Viewing the Scorecard in C360

The end state is that the Customer 360 page for each account (as appropriate) now has a Pageviews score which is correctly populated.

Summary and End Notes

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

It is important to note that this rule will only update scorecards for Accounts with Usage Data. To produce scorecards for those accounts without Usage Data, you would 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: