This article supports Gainsight NXT, the next evolution of the Customer Success platform. If you are using Gainsight CS Salesforce Edition, you can find supporting documentation by visiting the home page, and selecting CS > Salesforce Edition.
Not sure what your team is using? Click here.
Merge Tasks with Rules Engine
Gainsight’s Rules Engine integrates raw customer data into Gainsight and design multi-step data transformations with a merge option that transforms the data into a polished, actionable dataset.
Note: Merging a dataset to itself (Self-Merge) is not supported in Rules Engine.
Create a Rule
- Navigate to Rules Engine > RULES LIST tab.
- Click +RULE.
- In the Create Rule screen, enter the required information in the fields available. In this use case, the following information is used as example:
- Rule For: Company
- Rule Name: Merge task
- Folder: select a folder for the rule.
- Description: [Optional]
- Click NEXT. The Setup Rule screen is displayed.
Create Data Set 1 (Fetch Task 1)
- Click DATASET to create data set 1.
- Enter Task Name (here it is Fetch from Company Object), Task Description (Optional), and Output Dataset Name (here it is Fetch from Company).
- Select Company as the source object, add fields in the Show/Filters sections and click SAVE.
- Click to go to the Setup Rule screen where you can view the first fetched dataset that is performed in this Rule.
Create Data Set 2 (Fetch Task 2)
- Click +TASK > Dataset to create data set 2.
- Enter Task Name (here it is fetch from Survey Participant), Task Description (Optional), and Output Dataset Name (here it is fetch from MDA).
- Select Survey Participant as the source object, add fields in the Show/Filters sections and click SAVE.
- Click to go to the Setup Rule screen where you can view the second fetched data set that is performed in this Rule.
If you click NEXT, it shows the following error message.
Or, if you click Setup Action directly, it will also show the following error message.
The reason behind showing these error messages is for having two output tasks available in the Setup Rule screen. You should apply merge/pivot/aggregate multiple datasets to one output dataset to proceed further. The following sections provide step-by-step guidelines about how you can apply merge/pivot/aggregate multiple datasets fetched from multiple/single sources to create a single dataset task.
Even though you can setup actions on all the dataset tasks in a rule, you should apply merge and create a single output dataset task. Even if you do not want to setup an action on the final output dataset task, it should be created else the actions you setup on any dataset task will not be executed.
Merge Task to create single output
We now create a merge task which retains all records of Customers whose <MRR> is greater than 100 and who have responded to our Surveys.
- In the Setup Rule screen, click +TASK > click Merge.
- Enter Task Name (here it is merge task), Task Description (Optional), and Output Dataset Name (here it is merge task).
- In the Criteria section, select the following options for the available fields as used in this example:
- Merge: Fetch from Company
- With: Fetch from Survey Participant
- Select Join Type: Retain common records from both dataset
Note: For information about various join types, refer to the <<Join Types>>(TBA) article.
- Click + MERGE ON FIELD.
- Select Source: CSM Company ID, Company ID
- Select Target: Responded by Company ID, Responded By Company ID Name.
- The Show Fields section displays the list of fields fetched from both the Datasets. You can select the required fields to be displayed in the final result.
Use the Show Selected checkbox:
- Select to view the fields used in the merge task.
- De-select to view the newly added field in the respective Dataset task that is used in the merge task.
- [Optional] Select the Enable to S3 check box if you want to export it to S3. For more information about how you can Export to S3, please refer to the Export to S3 from Gainsight Rule article.
- Click SAVE and . The merged task will be available on the Setup Rule screen as shown in the following image.
Gainsight NXT in Salesforce CRMContent in this section supports Gainsight NXT accessing through Salesforce Login. To learn more about Gainsight NXT in Salesforce, click here.
- Click here for more information about merging datasets created from Salesforce objects, with Gainsight Objects
- If you have enabled Salesforce Connector, you can create Datasets from Salesforce objects. You can then merge Salesforce Datasets with Gainsight Datasets or even merge two Salesforce Datasets.
In the following image, Account Object from Salesforce is merged with Company object from Gainsight. The Account ID field from Account object and SFDC Account ID field from Company object is used for mapping.
Usage scenarios for Merge task
You can save a rule with multiple datasets even without using a Merge task, provided all your datasets are interconnected, thus resembling a tree structure. However, If you have created two or more independent datasets, you will still require a Merge task.
Merge task is not required in the following case
In the following diagram, a single dataset is created (Dataset A). A transformation task and a Pivot task were created from this Dataset. In this case, Merge task is not required since output datasets are interconnected, reminiscent to a tree structure. You can also create multiple transformation and pivot tasks on Dataset A, without requiring a Merge task.
Merge task is required in the following case
In the following diagram, two datasets A and B are created. These two datasets are independent and not connected in any way. Thus, a Merge task is required in this case.
If you create a Transformation task or Pivot task on any of the above datasets, you will still require a Merge task.
In the above case, you must create a Merge task to combine the transformation task from Dataset A and Pivot task from Dataset B.
We now create a Action for our Rule in which a CTA is created for every Customer whose MRR is greater then or equal to 100 and who responded to our Surveys.
- In the Setup Rule Action screen, provide the following data as used in this example:
- Action Type: Call to Action 2.0
- Company Identifier: Company Id
- Name: Enter a name
- Type: Activity
- Priority: High
- Reason: Survey Response
- Default Owner: Select a default owner for the CTA
- Click SAVE. For more information on how to set rule actions, refer to the Setup Rule Action Types article.
- Click RUN NOW to test the newly created rule. The Run Rule window is displayed. You can mention an email id where you want to receive a copy of the Rule Result and then click RUN.
Schedule the Rule
Use this option to schedule the execution of this rule in the same way you have scheduled custom rules. For more information about how to schedule an individual rule, refer to the Scheduling Rules article.