This article explains how to begin setting up a new Custom Rule. After completing the initial setup, refer to the articles Setup Rule Action Types and Schedule Rules for additional guidance. For more information about creating tasks using Bionic Rules, refer to the Bionic Rules Task Creation tutorial.

Add New Rule

  1. Navigate to the Rules Engine, click Administration > Rules Engine.
 
2. Click +RULE to add a new rule.
 

When adding a new rule you will have the option to create the following types of rules:

  • 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 like 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.

 

Rule Name: enter a descriptive name for your rule. For Admin rules, we recommend using the following naming convention:

  • {Area being updated - Subject Area of Data - Criteria, if applicable}
  • Examples: "Scorecard - Support - Red," or "Usage Data - Success Engagement - Risks Lost"

Description (optional): enter text that describes the purpose or effect of the rule.

CAUTION: Do not use quotation marks in the rule name or description fields, or you will experience problems with scheduling the rule. Quotes are an escape character in JSON.

Rules for Relationships

If you have Relationship types setup in your org, you can also create a rule for a relationship. In addition to the the fields mentioned above, select the appropriate Relationship Type from the drop-down box. In the Setup Action screen, you will have a limited set of actions to choose from with Relationships.

Notes: When you set up a rule for a relationship type, key fields related to a particular object are automatically added in the Show area. For example, if Relationship object is selected, Relationship ID and Relationship Account fields are automatically added in the Show area. The fields are dependent on the relationship setup itself, more precisely based on the Linked Objects Section. 

If a CTA is to be fired off a non-GS Relationship Object, such as opportunity, the tradition in which a CSM is pulled from the Account or Customer Info object to satisfy the CTA requirements, will not work. Therefore, a user lookup needs to be created on the Relationship Object to pull the CSM info. Given the lookup has to be created, a rule needs to be created to maintain that lookup field. 

Setup Custom Rule

To get started, choose Native Data (Salesforce), Matrix Data, or Data Spaces.

Setup Custom Rule

Note: When using Native Data (Salesforce), advanced logic is limited by the expression supported by Salesforce. Using Matrix data allows you to use more complex expressions.

Select Source Object

Select the source object from the select object drop-down.

Note: When using Native Data, you will see the Account and Customer Info object, if you choose an object that refers to account. If using Matrix Data, you will not see Account and Customer Info object as options.

IMPORTANT: All MDA Custom Objects (All data sources) created enables Admins to work with multiple data sets from multiple data sources; as well as process the data and perform actions in Bionic Rules.

Setup Rule Fields

Setup Rule Fields

After the object is selected, drag and drop the field(s) into the Show area, which will be used to push data into the target object (Usage Data or Customer).

  1. Show: Drag fields from the left side into this area to use in order to push data into the target object (Usage or Customer). These fields will allow you to fine tune the Action in the next step. IMPORTANT:  Adding Account Id is mandatory for saving the rule. Once the field is dragged over, use the dropdown to choose the aggregation type.
    Note: While setting up a new rule, the maximum number of fields that can be added to the Show field is restricted to 20. Calculated fields are also included while calculating the field limit.
  2. Filters (optional): These filters will be used as constraints to determine when an action needs to be taken.
    Example of how to approach date configuration in rule setup:
  • Use Case: I need to fire a CTA when the last conversation was more than 45 days ago.
  • Configuration: Set up a filter where "last conversation date" is less than or equal to "Subtract N days from Rule Date" where N=45.
  1. Apply to Gainsight customers only: When checked, actions will only apply to customers in your Gainsight data (as opposed to other records that may be stored in SFDC, for example).
  2.  Advanced Logic: If multiple fields are added to filters, then each filter condition is given a label. You can modify the Advanced Logic as needed.
  3. Add Calculated Field (optional): If needed, you may also add a Calculated Field to a Rule. For more information about Calculated fields, refer to the Using Calculated Fields in Rules article. (Note: aggregation of date/time fields is not supported.)
  4. Include accounts where data is unavailable: Allows you to perform actions for records that do not have data for the object fields selected in the Show section. This feature can be enabled when setting up a rule using the Include accounts where data is unavailable toggle button.

 For example, you might want to:

  • Create CTAs for accounts where there is no usage ( logins or particular usage measure )
  • Set the score to NA when there are no open support cases.
  • Create CTAs for accounts where there is no contact that is identified as an sponsor.

In other words, you are using rules to identify accounts that do not have cases or specific milestones associated with it. For more information, refer to Identifying Absence of Data via Rules.

Note: The “Apply to Gainsight customers only” option in the rule setup screen is respected. If you want your rule to look for all accounts in SFDC with an absence of data, then do not click the “Apply to Gainsight customers only” option.

  1. Account Lookup: It is not mandatory to include the Account ID field; you can use any other field that has a lookup to Account. However, you must have the selected Account Lookup present in the Show field to utilize all of the Action types while setting up actions. For example, if you have selected Account ID as account lookup, you must drag-and-drop the Account ID field in the Show field. 

Only Load to MDA and Load to SFDC are available while setting up actions for a rule in the following cases:

  • If the lookup field selected in Account Lookup is not present in the Show field.
  • If the lookup field selected in Account Lookup has an aggregation on it in the Show field.
  • If the lookup field selected in Account Lookup is incorrect and you have the correct lookup field in the Show field.

Time Filters

  1. Lifecycle in Weeks:

    • If Original Contract Date (OCD) is less than today
    • Formula: ABS(CEILING((JBCXM__OriginalContractDate__c - TODAY())/7))
    • Example OCD = 06/23/2015, Today = 11/16/2015 Lifecycle in Weeks = (06/23/2015-11/16/2015)/7, Lifecycle in Weeks = 21
  2. Lifetime in Months that increments each month.

    • Formula: (Year( TODAY() ) * 12 + Month( TODAY() ))-(Year( JBCXM__OriginalContractDate__c ) * 12 + Month(JBCXM__OriginalContractDate__c)))
    • Example OCD = 12/3/2013, Today = 11/16/2015
    • Lifetime in Months = ((2015*12)+11) - ((2013*12)+12), Lifetime in Months = 23

Preview Results

Once the rule is setup, you can click PREVIEW RESULTS, which will show the top 10 results matching your filter condition; or you can click NEXT to move to setting up actions.