Skip to main content
Gainsight Inc.

Automating Relationship Creation in a Company

Gainsight NXT

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.


IMPORTANT - Articles Impacted due to 6.34 October NXT Release

Due to the v6.34 October, 2022 release, this article has been impacted. Steps, images, and playable GIFs in this article will soon be updated to reflect the latest changes.

For more information about the latest UI changes, click here.



There can be multiple instances and use cases to create Relationships automatically as per your requirement. In this article, rule configuration is explained for the following use case.

When a new business deal is closed, you can track it as a new Relationship. However, creating relationships manually every time a new deal is signed can be tedious. This article explains how to create a rule which automatically creates Relationships based on set criteria.


  • A custom object called Project exists. When a new opportunity is identified, it is logged  as a new project record.
  • The Project object has a Status field. When this field is set to Won, the opportunity is considered won.
  • When an opportunity is won, the corresponding project record is converted into a new Relationship.
  • The Project object has a lookup to Company and Relationship Type fields.
  • A custom field Business Region exists in Project object. This field tracks the region from which customer is operating.
  • A custom field Geographical Region exists in Relationship Type object. This field is equivalent to the Business Region object and tracks the region from which customer is operating.

Create Rule

To create a Rule:

  1. Navigate to Administration > Rules Engine.
  2. Click + RULE. Create Rule window is displayed.
  3. Perform the following actions:
    1. Rule For: Select Company.
    2. Rule Name: Enter a name of the Rule.
    3. Folder: Select a folder from the drop-down list.
    4. (Optional) Description: Enter a description for the rule.
    5. Click NEXT. The Setup Rule window is displayed.

Setup Rule

Perform following actions in the Setup Rule page:

  1. Click DATASET.
  2. Enter Task Name and Output Dataset Name.
  3. Select the source object, Project here from the Source Object drop-down list.


  1. Drag and drop the following fields to the Show section:
  • Project Name
  • GSID
  • Company ID -> Name
  • Relationship Type ID -> Name
  • Business Region


  1. In the Filters section, add a filter to fetch data only for those project records with Status as Won.
  2. Click SAVE.


Setup Action

Perform following actions in the Setup Action page:

  1. Navigate to the Setup Action page.
  2. Click + ACTION.
  3. Select Load to Relationship V2 from the Action drop-down list.


  1. Select Upsert from the Operation drop-down list.
  2. Click the Import Lookup icon for Relationship:: Type Id field. The Data import lookup configuration window is displayed.
  3. Map the Business Region field from the Project object with Geographic Region field from the Relationship Type object.
  4. Click APPLY.


  1. Click the Import Lookup icon for Relationship:: Company Id field. The Data import lookup configuration window is displayed.
  2. Map the Company ID Name field of project object with Name field of Company object.
  3. Click APPLY.


  1. Map the Project Name field from Project object with the Name field in Relationship object and mark .
  2. Perform other mappings as required.
  3. Select at least one field mapping to mark as identifier for Upsert/Update operation.
  4. Click SAVE.
  5. Click RUN NOW to run the rule immediately or schedule the execution of the rule.


  • Was this article helpful?