The Rules Engine is where Admins can build business rules to trigger CTAs, update scorecard measures, send emails and pull data from any object into a Gainsight object. Rules analyze data from native (SFDC or Gainsight) sources or from the Matrix Data Platform. The Rules Engine only functions with source objects that are related, either through Master-Detail or Lookup, to the Salesforce Account object. Rules can only reference one object at a time, plus the Account and/or CustomerInfo object.

Prerequisite Knowledge

Before you begin building rules in Gainsight, it's helpful to know the following, or to work with your Salesforce Admin to understand:

  • Where is your usage data stored and how is it integrated? (Native/SFDC, Matrix/MDA, or Dataspaces)
  • What is the usage data loading frequency, granularity and data week?
    • weekly or monthly: will determine whether to sum/avg or max/min, etc.
    • granularity: user level, instance (product) level, or account level
    • data week: Sun - Sat, or Mon - Sun

Additionally, you must be familiar with Salesforce and Gainsight objects, to some extent:

  • Salesforce objects: most SFDC objects only contain the present state of data
  • CustomerInfo object: the equivalient of the Account object; it only contains the present state of data. Purpose of CustomerInfo object in Gainsight is to assemble various customer data in one object. During implementation, we make a mirror record if your account records on the CustomerInfo object.
  • Usage data object: Gainsight's usage data object contains historical data on the usage and engagement measures you choose to track, as well as weekly or monthly snapshots of your current usage data
  • MDA/Matrix Data: In order to access the Data Management console, and be able to view and load data, a user must have access to the Visual Force Page JBCXM.COM.

Gainsight Objects to Field Map:

  • Navigate to Setup > Installed packages > click JBARA CSM > View Components. You will see a list of all Apex Classes, VF Pages, Objects and Fields that are part of our Managed Package.

Rule Types

There are two rule types available in the Rules Engine:

  • CUSTOM: Use this rule to perform a single step process like fetch data and create CTA.

  • BIONIC: Use this rule type to perform multiple fetches and transformations in a single rule, such as fetch data from multiple sources, merge, aggregate, and then load to an object. For more information about Bionic Rules, refer to the Getting Started with bionic Rules article.

Rules for Accounts vs. Relationships

Most of the time, Admins will configure rules for Accounts. However, if you are using Relationships in Gainsight, you can also create rules at the Relationship level. See Relationships Overview for more information. For more information about Bionic Rules support at Account and Relationships levels, refer to the Getting Started with bionic Rules article.

Rule Building Process

The process for building a rule involves selecting a source object and all the fields on that object that you want to see or work with in the rule (20 max); optionally setting up filters to look for a subset of customers, and/or selecting criteria for doing different actions for Accounts or Contacts; configuring actions like triggering a CTA or loading data (50 actions max per rule); testing the rule, and scheduling it.  

The following articles walk you through the basic steps to create a Custom Rule:

  1. Rules Engine List View and Timeline View
  2. Initial Rule Setup
  3. Setup Rule Actions
  4. Schedule Rule

The following article walks you through the basic steps to create a Bionic Rule:

  1. Bionic Rules Tasks Creation
  2. Aggregate Usage Data with Bionic Rules
  3. Group Custom fields and Pivot ( Bionic Rules)

Rule Templates

With the May 2016 release of Gainsight, you can import Custom Rule templates from Gainsight Vault into your own org. For information about how to import Rules from Vault, refer to the Gainsight Vault article. For a list of the custom fields that were utilized in some of the rules, refer to the Vault Rules Custom Fields spreadsheet.

Rule Chain

Rule Chains are groups of related rules that have been chained together to execute one after another with a shared schedule. In the Rule Chain View, you can configure chains of rules, as well as view existing rule chains. For more information, refer to Creating Rule Chain.

Rules Engine Use Case Tutorials

Gainsight has an extensive library of rules engine use case tutorials and examples. See the Rules Engine area for links to specific guides.

Export List of Rules

In Nov. 2016, Gainsight introduced the Config Snapshot feature, which enables Admins to export a list of all of the rules in their org.

Some Admins like to keep a separate document to track all of their rules and associated actions, revisions, etc. This template was modeled after a document several of our customers are using.

Limitations

  • The rules engine can insert, upsert, and update, but does not support the delete function, and should not be used to try and delete data in SFDC or Gainsight. As a workaround, Admins can delete data from SFDC by exporting the data out, deleting it with jitterbit, dataloader, or a similar tool. Alternately, a script could be run via workbench or the developer console.
  • The Rule Results Excel sheet will contain only 100K records. We will make appropriate enhancements in upcoming releases so that the Excel sheet contains all of the fetched records.