Skip to main content
Gainsight Inc.

Bionic Rules Task Creation

This tutorial provides guidelines on how Admins can fetch data from multiple sources such as SFDC, MDA, and Data Spaces. This tutorial will guide you to perform actions using the Bionic Rule type (in Rules Engine) which has the capabilities to transform fetched data in various ways and execute actions with a single Bionic Rule. Users can perform Historical Rule Executions faster using Bionic Rule because of the data volume. 

Before you start exploring about how to create tasks in Bionic Rules, go through the Getting Started with Bionic Rules article.

Fetch Data

Fetch from SFDC, MDA, or Data Spaces

  1. Navigate to Rules Engine > RULES LIST tab > +RULE. The Edit Rule screen will be displayed.

  1. From the Rule Type drop-down list, select Bionic.

  1. Select Account checkbox as Rule For.

  2. Provide Rule Name.

  3. Provide Description [Optional].

  4. Click NEXT. You will be navigated to the Edit Rule screen.

  5. Click DATASET TASK.

  1. Select Native Data, Matrix Data, or Data Spaces from the drop-down list on the Setup Rule screen to get the data from SFDC, MDA (Redshift only), or Data Spaces.

  1. Select Usage Data as the source object of Native Data.

  1. Fetch the following Usage Data by dragging-dropping them in the Show section, as shown in the following image.

  1. Enter the Task Name, Task Description, and Output Dataset Name.
    Note:
    Output Dataset Name auto populates from Task Name and it can be changed to different name. It has no dependency on Task Name.  

In this use case, the following details are used:

  • Task Name: Fetch from usage data [Maximum 80 characters and should be Alphanumeric; _ and space are supported]

  • Task Description: Usage data fetch [ Maximum 200 characters]

  • Output Dataset Name: Usage Data [Maximum 60 characters and should be Alphanumeric; _ and space are supported]. This gets pre-populated with the task name by default.

  1. Click SAVE to create a task and query from Usage Data on the fields selected earlier. You can also add Filters. This task is now available for you to proceed further.

While creating tasks for Bionic Rules, you need to keep the following points in mind:

Max # of tasks allowed 10  
Max # of Show fields in each task 50 In Pivot task, we can pivot on a field using 200 cases
Max # of Group by fields in transformation tasks 5  
Max # of filters allowed in each task 26 This limit is in filters of every task. But there are no limits in action filters

IMPORTANT

  • Fetch tasks support data sources from SFDC, MDA (Redshift Only), and Data Spaces.

  • Each field in every task can have a field label input by the user which will be used as a field alias while querying and as a output header in the csv result. While querying from usage data, if any of these field aliases contains reserved keyword, you must modify the Output Field Label name before clicking SAVE, otherwise it displays the following error message.

The Date is a reserved keyword and you need to change it. You can simply click the gear icon available for this field to rename the Output Field label within the context of this Bionic Rule, as shown in the following image. The Output Header name will be modified based on whatever name you give to Output Field Label (space will be replaced with ‘_’). Once you save the task, the Output Header cannot be changed.

Note: In general, "Date" is one of the reserved keyword(s) for Output Field Label.

  • Group by Date and DateTime includes various functions at Day, Week, Month, Quarter, and Year. You can add Date field in the GroupBy section in any of the Transform tasks (Aggregate/Pivot). For more information about custom grouping, refer to the Custom Grouping, Time Series, and Pivoting article.

Note: By default Created Date is set to Day, and aggregation is allowed, but for DateTime aggregation is not allowed which means there will not be any drop-down list available for this field in the Show section. When you add Date/DateTime field in the GroupBy section, it automatically gets added in the Show section and you can see the available options for the same field under the Show section only if you selected the function (in GroupBy section) which can be aggregated (refer the image below).

Transform Task

Earlier, you were not able to transform the data using Custom Rules. Transform tasks that are supported in Bionic Rule are Merge, Aggregation, and Pivot.

Merge

Bionic Rules integrate raw customer data into Gainsight and design multi-step data transformations with 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

  1. Navigate to Rules Engine > RULES LIST tab > Click +RULE.

  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]

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

Create Data Set 1 (Fetch Task 1)

  1. Click DATASET TASK to create data set 1.

  1. Enter 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 as shown in the following image.

  1. Click to go to the Setup Rule screen where you can view the first fetched dataset that is performed in this Bionic Rule.

 

Create Data Set 2 (Fetch Task 2)

  1. Click +TASK > Dataset to create data set 2.

  1. Enter Task Name (here it is fetch from mda), Task Description (Optional), and Output Dataset Name (here it is fetch from mda).

  2. Select Matrix Data (MDA).

  3. Select Account as the source object, add fields in the Show/Filters sections and click SAVE as shown in the following image.

 

  1. Click 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.

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 present in the Setup Rule screen and in Bionic Rule, all the outputs must be merged/pivoted/aggregated as there can be only one output task to proceed further. The following sections provide you step-by-step guidelines about how you can merge/pivot/aggregate multiple/single tasks fetched from multiple/single sources to transform a single Bionic Rule.

Merge Task to create a single output

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

  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
      Note: For information, refer to the Join Types article.

 

 
  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

Show Fields will display the list of Fields and Output Field labels fetched from both SFDC and MDA. 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.

  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. or more information about how you can Export to S3, please refer to the Export to S3 from Bionic Rule article.

 

Perform Action

  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]

  2. Click +CRITERIA. In this example, it is page views > 10000.

 

  1. Click SAVE. For more information on how to set rule actions, refer to the Setup Rule Action Types article.
  1. 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. If you need additional information about how to schedule an individual rule, refer to the Scheduling Rules article.

Pivot

Create Bionic Rule

  1. Navigate to Rules Engine > RULES LIST tab > Click +RULE.

  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:
    • Description: [Optional]

    • Rule Name: Pivot on page names

    • Rule For: Account

    • Rule Type: Bionic

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

Create Data Set (Fetch Task)

  1. Click DATASET TASK to create a data set.

  2. Enter Task Name (here it is fetch from usage data), Task Description (Usagedata fetch), and Output Dataset Name (here, it is Usage Data).

  3. Select Account as the source object, add fields in the Show/Filters sections and click SAVE as shown in the following image.

 

  1. Click to go to the Setup Rule screen where you can view the fetched dataset that is performed in this Bionic Rule.

 

Pivot Task to create a single output

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

  1. Enter Task Name (here it is Pivot on page visits), Task Description (Page visits pivot), and Output Dataset Name (here it is Page visits).
  2. In the Setup Rule screen, select Dataset and Usage Data as source object. Select the following options for the available sections on this screen as used for pivoting task in this example:
    • Pivot on: Page Views 23

    • Show: Account Name 23

 

  1. Click on the gear icon for the Page_Views field. The Pivot conditions to evaluate window will be displayed. In this use case the following conditions are used for pivoting on the page views (refer the following image):

 

Note: While pivoting any task, you must add one field under GroupBy section. Otherwise, it will display an error message while saving the task. Refer to the following image.

 

5. Add a field in the GroupBy section. (In this use case, it is Account Name 23)

 

6. Click SAVE. The following message is displayed.

 

On Setup Rule screen, you can see the fetched task, pivoted task and also the Data Flow Diagram as shown in the following image.

 

Perform Action

  1. In the Setup Rule Action screen, provide the following data as used in this example (refer the following image):
    • Owner field: NA (whatever fields you add in the Setup Rule > Show section, all of them will be available under the dropdown list).

    • Action Type: Load to Company

    • Operation: Update

  2. Click +CRITERIA [No page vies >= Value 0]

  3. Click SAVE.

  1. Navigate to RULES LIST tab where you can run this newly created Bionic Rule by clicking RUN NOW.

Clicking RUN NOW displays the Run Rule window where you can mention date and an email id where you want to send a copy of the Rule Result and then click RUN.

 

Schedule

You can use this option to schedule the execution of this rule in the same way as you schedule in Rules Engine for other rule types before. For more information about how to schedule an individual rule, refer to the Scheduling Rules article.

Transformation

Create Bionic Rule

  1. Click +RULE.
  2. 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: Use case
  • Description: [Optional]

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

Create Data Set (Fetch Task)

  1. Click DATASET TASK to create a data set.
  2. Enter Task Name (here it is fetching data), Task Description (fetchdata), and Output Dataset Name (here, it is Fetching data).
  3. Select Account as the source object, add fields in the Show/Filters sections and click SAVE .

Aggregate Task to create a single output

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

2. Enter the Transformation Task Name (here it is aggregation), Task Description (optional), and Output Dataset Name (here it is aggregation).

3. In the Setup Rule screen, select Fetching data as source object of dataset. Select the following options for the available sections on this screen as used for pivoting task in this example:

  • Show: COUNT of Chart id, Date field
  • GroupBy: Date Field (this is aggregated in this example).

Note: Add the Chart id field in the GroupBy section, so that you can select any one of the following options from the drop-down list  for Chart id in the Show section as shown in the following image and save the task.

When you try to use the field in Show section as it is without changing, you will not not be able to save the task after modifying the field in the Show section as this is reserved-keyword. it will display the following error message.

4. Click SAVE. The following confirmation message will be displayed.

See Also:

  • Was this article helpful?