Skip to main content
Gainsight Inc.

Merge Tasks in Bionic Rules

This article explains how you can transform data into a polished, actionable dataset in Bionic Rules using the Merge option.

Merge Tasks

Bionic Rules integrate 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 Bionic Rules.

Create Bionic Rule

To create a bionic rule:

  1. Navigate to Rules Engine > RULES LIST tab.

  2. Click Create Rule.

RED1.png

  1. In the Edit Rule screen, enter the required information in the fields available. In this use case, the following information is used as example:

  • Rule Type: Bionic
  • Rule For: Account
  • Rule Name: merge task = sfdc + mda
  • Description: [Optional]

clipboard_e11117d7e35bc088950d4c04dd84a3871.png

  1. Click NEXT. The Setup Rule screen is displayed.

Create First Dataset (First Fetch Task)

To create the first Dataset:

  1. Click DATASET to create data set 1.

clipboard_eaee17c9a5d736fd0972af94575cd8177.png

  1. Task Name (here it is fetch from sfdc), Task Description (Optional), and Output Dataset Name (here it is fetch from sfdc).
  2. Select Account as the source object, add fields in the Show/Filters sections and click SAVE.
  3. Click <- symbol to go to the Setup Rule screen where you can view the first fetched dataset that is performed in this Bionic Rule.

Create Second DataSet (Second Fetch Task)

To create the second Dataset:

  1. Click +TASK > Dataset to create data set 2.
  2. Enter Task Name (here it is fetch from mda), Task Description (Optional), and Output Dataset Name (here it is fetch from mda).
  3. Select Matrix Data (MDA).
  4. Select Company as the source object, add fields in the Show/Filters sections and click SAVE.
  5. Click <- symbol to go to the Setup Rule screen where you can view the second fetched data set that is performed in this Bionic Rule.

If you click NEXT, it shows the following error message.

Multiple Dataset Error.png

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 you 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 Bionic 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 otherwise the actions you setup on any dataset task will not be executed.

Merge Task to create single output

To create a merge task:

  1. In the Setup Rule screen, click +TASK > click Merge.

+Task > Merge.png

  1. Enter Task Name (here it is merge task), Task Description (Optional), and Output Dataset Name (here it is merge task).

  1. In the Criteria section, select the following options for the available fields as used in this example:

  • Merge: fetch from sfdc
  • With: fetch from mda
  • Select Join Type: Retain common records from both dataset. For information about various join types, refer to the Join Types article. 

image.png

  1. Click MERGE ON FIELD. This adds the following fields (entered/selected data is for this use case):

  • Select Source: Account Name, Created Date
  • Select Target: Account Name, Created Date
  • Enable or disable case insensitive mapping: Select or deselect this check box to enable or disable case insensitive mapping.

Merge_CaseSensitivity.png

  1. Show Fields display the list of Fields fetched from both SFDC and MDA and Output Field labels. You can select Account id (fetch from mda in this example) option from the Account lookup drop-down list. If you want to export this task to S3, select the Enable Export check box. For more information about Export to S3, refer to the Export to S3 from Bionic Rules article.
    Show Selected check box:
  • 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.
  1. Click SAVE. The merged task will be available on the Setup Rule screen as shown in the following image.
  2. [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 Bionic Rule article.

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.

Case one.png

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.

Case two.png

If you create a Transformation task or Pivot task on any of the above datasets, you will still require a Merge task.

Case 3.png

In the above case, you must create a Merge task to combine the transformation task from Dataset A and Pivot task from Dataset B.

Perform Action

To setup an action on the rule:

  1. In the Setup Rule Action screen, provide the following data as used in this example:

  • Action Type: Load to Milestone
  • Date: Constant/Rule date
  • Milestone: Launch Expansion
  • Comments: [Optional]
  1. Click +CRITERIA. In this example, it is page views > 10000.
  2. Click SAVE.
    For more information on how to set rule actions, refer to the Setup Rule Action Types article.
  3. 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

Use this option to schedule the execution of this rule in the same way you have scheduled custom rules. For more information on how to schedule an individual rule, refer to the Scheduling Rules article.

See Also:

  • Was this article helpful?