This tutorial demonstrates an example for which the Rules Engine can be used to perform field comparisons to trigger certain actions. This use case will walk you through the process of creating a Bionic rule that triggers a CTA when a CSM assignment changes. The CTA will assist with Account Transition to the newly assigned CSM (via a Playbook).

To get started you will create the following:

  1. Create New Custom Field in SFDC
  2. Give Permissions to CSM User Lookup Fields
  3. Create a Rule to copy/push values each day
  4. Create another rule which performs the comparison and create a CTA

Notes:

Salesforce.com Data

  • Data within Salesforce.com (SFDC) is "Present State"
  • This means that you cannot implicitly detect changes in SFDC data without leveraging additional means

Field Types

  • Field comparison requires that fields be of the same type
  • Comparisons made between different types of fields will produce no results

Updating Fields in Salesforce.com (SFDC)

When using the "Load to SFDC Object", you can potentially overwrite data! Test all rules before running them in a production environment.

Create Custom Field in SFDC

In this step, create a custom field in SFDC Account object - call it “Last EBR Date”.

To create the Custom Field, perform the following steps:

  1. Click the dropdown on your name to navigate to the Object Page.
  2. Click Setup.

Object Page_Setup.png

  1. Scroll down and click Accounts.
  2. Click Fields.

Objects_Customize.png

  1. Scroll down and click Accounts.
  2. Click Fields.

Accounts and Fields.png

  1. Scroll down until Account Custom Fields & Relationships is visible.
  2. Click New.

Create NEW Custom Field.png

  1. Scroll down and click Lookup Relationship.
  2. Click Next.

Click Lookup Relationship.png

  1. Select Account from the dropdown list.
  2. Click Next.

Select Account.png

  1. Type in an appropriate Field Label.
  2. Field Name is auto populated after clicking in the field.
  3. Provide description in Description (optional) area.
  4. Click Next.

Custom Field Label Name.png

  1. Depending on the desired access levels, the Field-Level Security settings may be changed.
  2. Click Next.

Field Level Security.png

  1. Verify all information is correct.
  2. Select the required Page Layout Name(s).
  3. Click Next.

Field Page Layout.png

  1. Verify the information in the Related List Label is correct.
  2. Click Save.

Verify List Label.png

Give Permissions to CSM User Lookup Fields

In this procedure, we are providing the Admin access to the CSM Old user lookup field, to use it in the Rules Engine.
Note: You can access the Settings area only if the permission set called Gainsight Special is added to your user’s profile.

  1. Navigate to Administration > Rules Engine.
  2. Click Rules Settings.

RED4.png

  1. In the Permissions (Load Actions) section, click Add Object.
  2. Select Native Data and Account object. The list of available fields appear.
  3. Select CSM Old.
  4. Click Save.

RED5.png

Create Rule to Push Old CSM Value to Custom Field

Name the Rule

  1. Navigate to Administration > Rules Engine.
  2. Rule Type:  Select Bionic.
  3. Rule For: Select Account.
  4. Rule Name: “Admin-CSM Change-Push Old CSM Value”
  5. Description: <Something denoting intent of the rule>
  6. Click NEXT. Setup Rule page appears.

clipboard_eaf98e89882aba14291baa6674ac78695.png

Setup Rule

  1. Select Salesforce as the data source.
  2. Select Account as the source object.
  3. Add the following fields to the Show fields section:
  • Account::Id
  • Account::CSM
  • Account::CSM Old

Setup Rule.png

  1. Click SAVE.

Setup Action

  1. Click + ACTION and select the dataset.
  2. Select Load to SFDC Object for the Action Type.
  3. Select Object Name as Account and Operation as Update.
  4. The following three fields will auto populate (Created from the "Show" section on Rule Setup).
  • ID 
  • CSM (REFERENCE) 
  • CSM Old (REFERENCE)
  1. Map the following fields as:
  • Account Id  → Id (ID) - Check the "Include in Identifiers" checkbox
  • CSM (REFERENCE)  → CSM Old (REFERENCE)

Setup Action.png

  1. Click +CRITERIA.
  • Add:  Account::CSM Old | not equals | Account::CSM

Note: This only selects fields for which there is a difference, reducing the total number of updates.

  1. Click SAVE and proceed to the next step.

Test the Rule

Test your rule to ensure that records are correctly copied from the "CSM field" to the "CSM Old" field.

  1. Click Run Now.
  2. For a test run, check the box adjacent to "No actions will be performed."
  3. Click RUN.

Test RULE.png

Note: On your first run, all records will be updated. On subsequent runs, only fields which have changed will be updated.
When you are satisfied that the rule will run correctly, you may run again and update records.

Create Rule to Compare Field and Create CTA

In this step, you will create a second rule which will perform the field comparison.

Name the Rule

  1. Navigate to Administration > Rules Engine.
  2. Rule Type:  Select Bionic.
  3. Rule For: Select Account.
  4. Rule Name: "Admin - CSM Change - Create CTA when CSM Assignment Changes"
  5. Folder: Select a folder for the rule.
  6. Description: Enter a description.

Setup Rule

  1. Select Salesforce as the data source.
  2. Select Account as the source object.
  3. Add the following fields to the Show fields section:
  • Account::Id
  • Account::CSM
  • Account::CSM Old
  • Account::Account Name

Setup Rule 2.png

  1. Click SAVE.

Setup Action

  1. Click + ACTION and select the dataset.
  2. Configure the Action as shown below:
  • Action: Call to Action
  • Create/Close:  Create CTA
  • Name: Admin-CSM Change-Please Review Account
  • Type: Lifecycle
  • Priority: Low
  • Status: New
  • Playbook: TBD based on Playbooks your company has created.
  • Reason: TBD based on what Reasons your company has created.
  • Owner Field: Account::CSM (Your CSM Lookup field added in the previous step)
  • Default Owner: <Your Name or Other Default Name> (Gainsight Lead or Success Lead)
  • Due Date: Run + 5 Days
  • Post Update to Chatter: This determines whether new comments are added each time a CTA of this type fires while another is still open.
  • Comments: The CSM assignment has changed for $(Account:Account Name) from $(Account:CSM Old) to $(Account:CSM). Please review playbook.

Setup Action Rule2.gif

  1. Click Criteria
  • Add: Account::CSM Old | not equals | Account::CSM
  1. Click SAVE.

Test CTA Rule

As before, select at least one record to alter by changing the CSM assignment manually.

Run this rule BEFORE running the "Push Old Values" rule, as it will work by comparing differences. 

CSM_Accounts in SFDC.png

To change a record:

  1. Select an Account within SFDC. 
  2. Click Edit on the Account Detail. 
  3. Find the field you wish to change (In this case, the CSM field). 
  4. Click Save. 
  5. ​​​​​​​Perform a test run on the rule.

Once you are certain that the rule affects the changes you desire, you may run and confirm that it works correctly.

Schedule Your Rules

This tutorial explains a use case in which you may use bionic rules to update data and trigger CTAs.  
In such a case, correct scheduling of rules is extremely important.  For comparing data and running rules you may want to set a schedule as follows:

Step 1:

  • Perform comparison - Run "Admin - CSM Change - Create CTA when CSM Assignment Changes"

Step 2:

  • Update fields - Run "Admin - CSM Change - Push Old CSM Value"

In other words, you compare first and "sync" old/new fields second.  Thus, on the next date if there are no changes, the "Compare" rule will detect no changes and no CTA will be created.