Skip to main content
Gainsight Inc.

Tutorial: Sync Company Updates to External Application using Real-Time Rules

Gainsight NXT


This article explains how to sync Company changes to external applications using Real-Time Rules. 


Using the Call External API action type in Real-Time Rules, update the FreshdeskTM (an external system) immediately when the Company stage is changed. For more information on the Real-Time Rules feature, refer to the Real-Time Rules article.

This tutorial has three sections:

Configure Custom Connector

You must first configure a connection with FreshdeskTM. For more information on how to configure a custom connector in Gainsight, refer to the Configure Custom Connectors article.

Setup External Action

This section explains how to create an action for the external connection created in the previous section. 

To access the External Actions page:

  1. Navigate to Administration > External Actions
  2. Click Create Action. The Create Action page appears.
  3. In the Basic Information section:
    1. From the Select a Connector drop-down, select the Slack Connection created in the previous section.
    2. Enter a name (FreshdeskTM) for the action in the Action Name field. 
    3. Enter the PUT URL of the FreshdeskTM company to which you wish to update. The URL shown below is for a test FreshdeskTM account and this would vary for your instance. 


  1. In the Payload section, enter the following API code:

    "name": "{{Company_Name}}",
    "custom_fields": {
        "stage": "{{Stage}}"

The above example API code creates Name and Stage fields.

  1. In the Headers Information section, by default, the Content-Type: application/JSON value is auto-populated. 
  2. In the Fields section, configure the data type for the fields created in the payload section.
  3. In the Advanced Configuration Information section, set the value to 3.
  4. Click Create.

Configure Real-Time Rule

This section explains how to configure a Real-Time rule to sync Company stage changes to an external application.

To configure the Real-Time rule:

  1. Navigate to Administration > Rules Engine > Real-Time Rules tab.
  2. Click New Rule. A new page appears, where you can view the following three tabs:
  • Details
  • Configure 
  • Actions


Details Tab

Enter the following information in the Details tab. 

  1. Rule Name: Sync Company Stage to External App.
  2. Select Folder: Select the folder in which you want to add this rule (or) by default, the rule is saved to the Uncategorized folder. 
  3. (Optional) Description: Provide a brief description of the rule.
  4. Click Configure to update the rule details, and navigate to the Configure tab.

Details Tab-Tut2.png

Configure Tab

To configure a Rule:

  1. In the Select an Event section:
    1. From the Event Topic drop-down, select Company.
    2. From the Event drop-down, select Stage Changes.
      By default, the Stage field is added to the list. Additionally, you can drag and drop other event fields to be synced to an external application.
  2. Click Actions to update the rule details, and navigate to the Actions tab.

Configure Tab-Tut2.png

Actions Tab

To create an Action:

  1. Click Create Action.
  2. Select Call External API action type. 
  3. From the Connector drop-down, select Slack.
  4. From the External API drop-down, select FreshdeskTM.
  5. In the Field Mappings section:
  • Enter a unique FreshdeskTM Company ID to be updated.
  • Select New Name in the Company Name drop-down.
  • Select New Stage in the Stage drop-down.
  1. Click Save Rule.
  2. Click Close.
  3. Turn on the Status toggle switch to execute the rule.

Actions Tab-Tut2.png

This rule is executed when there is a change in Company Stage, and the corresponding stage changes are updated to the Company details in the FreshdeskTM application.