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:
- Create New Custom Field in SFDC
- Give Permissions to CSM User Lookup Fields
- Create a Rule to copy/push values each day
- 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:
- Click the dropdown on your name to navigate to the Object Page.
- Click Setup.
- Scroll down and click Accounts.
- Click Fields.
- Scroll down and click Accounts.
- Click Fields.
- Scroll down until Account Custom Fields & Relationships is visible.
- Click New.
- Scroll down and click Lookup Relationship.
- Click Next.
- Select Account from the dropdown list.
- Click Next.
- Type in an appropriate Field Label.
- Field Name is auto populated after clicking in the field.
- Provide description in Description (optional) area.
- Click Next.
- Depending on the desired access levels, the Field-Level Security settings may be changed.
- Click Next.
- Verify all information is correct.
- Select the required Page Layout Name(s).
- Click Next.
- Verify the information in the Related List Label is correct.
- Click Save.
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.
- Navigate to Administration > Rules Engine.
- Click Rules Settings.
- In the Permissions (Load Actions) section, click Add Object.
- Select Native Data and Account object. The list of available fields appear.
- Select CSM Old.
- Click Save.
Create Rule to Push Old CSM Value to Custom Field
Name the Rule
- Navigate to Administration > Rules Engine.
- Rule Type: Select Bionic.
- Rule For: Select Account.
- Rule Name: “Admin-CSM Change-Push Old CSM Value”
- Description: <Something denoting intent of the rule>
- Click NEXT. Setup Rule page appears.
Setup Rule
- Select Salesforce as the data source.
- Select Account as the source object.
- Add the following fields to the Show fields section:
- Account::Id
- Account::CSM
- Account::CSM Old
- Click SAVE.
Setup Action
- Click + ACTION and select the dataset.
- Select Load to SFDC Object for the Action Type.
- Select Object Name as Account and Operation as Update.
- The following three fields will auto populate (Created from the "Show" section on Rule Setup).
- ID
- CSM (REFERENCE)
- CSM Old (REFERENCE)
- Map the following fields as:
- Account Id → Id (ID) - Check the "Include in Identifiers" checkbox
- CSM (REFERENCE) → CSM Old (REFERENCE)
- 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.
- 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.
- Click Run Now.
- For a test run, check the box adjacent to "No actions will be performed."
- Click RUN.
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
- Navigate to Administration > Rules Engine.
- Rule Type: Select Bionic.
- Rule For: Select Account.
- Rule Name: "Admin - CSM Change - Create CTA when CSM Assignment Changes"
- Folder: Select a folder for the rule.
- Description: Enter a description.
Setup Rule
- Select Salesforce as the data source.
- Select Account as the source object.
- Add the following fields to the Show fields section:
- Account::Id
- Account::CSM
- Account::CSM Old
- Account::Account Name
- Click SAVE.
Setup Action
- Click + ACTION and select the dataset.
- 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.
- Click Criteria.
- Add: Account::CSM Old | not equals | Account::CSM
- 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.
To change a record:
- Select an Account within SFDC.
- Click Edit on the Account Detail.
- Find the field you wish to change (In this case, the CSM field).
- Click Save.
- 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.