Salesforce notification: Email Customer Success team for G2 reviews with low scores
  • 15 Jun 2022
  • 5 Minutes to read
  • Dark
    Light

Salesforce notification: Email Customer Success team for G2 reviews with low scores

  • Dark
    Light

Article summary

A low net promoter score (NPS) provides direct insight into customer dissatisfaction. For customer success teams, this indicates an opportunity to contact your customer to address their feedback, offer educational materials, and make them aware that help is available. This example notification sends an email to a Salesforce account’s customer success manager when your product receives a G2 review with an NPS below 7.

1. Create the record-triggered flow

To create a new flow:

  1. At the top-right corner of any Salesforce page, select Setup.
  2. In the left sidebar, go to Build > Create > Workflow and Approvals > Flows.

If using Salesforce Lightning, go to Process Automation > Flows.

  1. Select New Flow to open the Flow Builder.
  2. Select Record-Triggered Flow, then Create.
  3. Find the G2 Review object by searching for G2Crowd__G2_Review__c in the Object search box. Set Configure Trigger to A record is created or updated.
  4. Set Entry conditions.

For this example, the entry conditions are used to filter for new G2 reviews with an NPS below 7. Set the Conditions Requirements dropdown to All Conditions Are Met (AND) and add the following condition:

RowFieldOperatorValueDescription
1G2Crowd__NPS__cLess Than7Finds G2 reviews with an NPS below 7.
  1. Set When to Run the Flow for Updated Records to Every time a record is updated and meets the condition requirements.
  2. Set Optimize the Flow to Actions and Related Records, then select Done.
  3. In the top-right corner of Flow Builder, select Save, then enter a name for your Flow (Flow Label). The Flow API Name auto-populates based on your Label entry.
  4. Select Save to finalize your Flow creation.

2. Create the notification Resources

Resources enable you to create custom variables, formulas, and text templates to customize your notification with specific review data, such as a record URL, an account name, and the account owner’s email address. This notification uses variables to fill in G2 Review data, formulas to fill in direct URLs to the account and review records, and text templates to use the variables and formulas in the notification message body.

To create the variables for your notification:

  1. In the left sidebar of the Flow Builder, select New Resource, then select Variable from the Resource Type dropdown.
  2. Enter an API Name (this is the name for your variable), set the Data Type to Text and check Available for input. A Default Value box will appear.

To enter a Default Value, you must understand how to access G2 custom objects in Salesforce.

adding a variable

For example, to access the email address of an account owner, select Record > G2Crowd__Account__ > Owner > Email. You must select the dropdown option at each step to build your Default Value. Your final Default Value is $Record.G2Crowd__Account__r.Owner.Email.

The following table illustrates the API Name, the Default Value, and the search queries you should enter into the text box to quickly access the correct value.

API NameDefault ValueSearch query
EmailAddress$Record.G2Crowd__Account__r.Owner.EmailRecord > Account__r > Owner > Email
  1. Repeat steps 1 and 2 for each of the following variables, making sure to set the Data Type to Text and check Available for input for each new variable:
API NameDefault ValueSearch query
NPS$Record.G2Crowd__NPS__cRecord > NPS
ReviewerCompany$Record.G2Crowd__User_Company__cRecord > User Company
ReviewerName$Record.G2Crowd__User_Name__cRecord > User Name
RecordID$Record.IdRecord > Record ID
G2Title$Record.G2Crowd__Title__cRecord > Title
G2URL$Record.G2Crowd__URL__cRecord > URL

To create formulas to populate your notification with Salesforce URLs that link directly to the Salesforce review record:

  1. In the left sidebar of the Flow Builder, select New Resource, then select Formula from the Resource Type dropdown.
  2. Set the Data Type to Text, enter the following information to build an account URL, then select Done:

| API Name | Formula |
| --- | --- |--- |
| RecordURL | LEFT({!$Api.Partner_Server_URL_260}, FIND( '/services', {!$Api.Partner_Server_URL_260})) + "/lightning/r/G2Crowd__G2_Review__c/" + {!RecordID} + "/view" |

To create the text template for your notification message body:

  1. In the left sidebar of the Flow Builder, select New Resource, then select Text Template from the Resource Type dropdown.
  2. Enter the name for your message template under API Name. G2 recommends the name MessageBody.
  3. Set the View dropdown to View as Plain Text.
  4. Enter your notification message into the Body text box. Your message should use the custom variables you created to fill in relevant data. Select Insert a resource to add one of the variables you created. For this example, you can paste the following message into the Body:
CSM Team,
A recent G2 review received an NPS of {!nps}.
G2 Page Title: {!G2Title}
G2 Review URL: {!G2URL}
Reviewer Name: {!ReviewerName}
Reviewer Company: {!ReviewerCompany}
Record URL: {!RecordURL}
-Your Salesforce Admin
  1. Select Done.

To create the text template for your notification subject line:

  1. In the left sidebar of the Flow Builder, select New Resource, then select Text Template from the Resource Type dropdown.
  2. Enter the name for your subject line template under API Name. G2 recommends the name MessageSubject.
  3. Set the View dropdown to View as Plain Text.
  4. Enter your notification message into the Body text box. Select Insert a resource to add one of the variables you created. For this example, paste the following message into the Body:
Low NPS G2 Review — {!ReviewerCompany}
  1. Select Done.

3. Add the email notification Action

adding an action

  1. Select the + below the the Record-Triggered Flow Start, then select Action.
  2. Search for and select Send Email to open the New Action editor.
  3. Enter a Label for your action, such as Email Notification. The API Name auto-populates based on your label entry.
  4. Select your MessageBody Text Template from the Body search box.
  5. Select your MessageSubject Text Template from the Subject search box.
  6. Set the Email Addresses (comma-separated) slider to Include. Enter a general email address for your CSM team, or a comma-separated list of CSM emails.
  7. Select Done to commit your changes to the action. Select Save to apply your changes to the flow.

4. (Recommended) Test and activate your flow

G2 strongly recommends testing your flow before activation. To test your flow:

  1. Select Debug from the Flow Builder top-right menu.
  2. Leave all parameters set to their default settings.
  3. Enter a G2 Review ID into the G2 Review search bar to debug your flow using a specific test case. You might have to go to the G2 Reviews tab in a separate window to find Review IDs.

G2 recommends choosing a review that meets your entry conditions and one that does not meet your entry conditions to assess that your Flow behaves as intended. For this example, test a G2 Review record with an NPS below 7, then test one that has an NPS above 7.

  1. Select Run to begin your debug.
  2. Open the Start Condition Requirements and Action (denoted by a lightning bolt icon) tabs to view how your text templates were filled with your custom variables and formulas.
  3. When satisfied, select Activate to turn on your flow.