This integration allows you to automate the process of sending customer survey invitations to your customers at the back of action taken in Salesforce. This integration leverages Salesforce Flow to trigger an incoming webhook call to CustomerGauge.
Steps - Example Scenario - Trigger a webhook call to CustomerGauge when a contact is updated.
- Set up the CustomerGauge webhook. Follow the Setup process documented here https://support.customergauge.com/support/solutions/articles/5000874298-incoming-webhooks
- Get the Webhook URL, Username, and Password ready. You will need it for the next steps.
- In the Salesforce system, we will need to use “Flow with HTTP Callout Action” to trigger the webhook call. In order to do that, follow these steps.
- Set up the “Permission Set”
- Go to Setup → Permission Sets
- Create new permission
- Setup the “Sets”
- Give the label a name that properly describes the use case
- Save
- Manage Assignments: Assign the user that needs to be able to use the permission sets set above.
- Set up the “Named Credentials”
- Go to Setup → Named Credentials
- Go to the “External Credentials” tab, and create new credentials
- Label: CustomerGauge_External_Credential (or any label you like)
- Name: Same as above or if you use your own, make sure there is no space in the name
- Authentication Protocol: Custom
- Go to the “Principals” section. Create new “Principals”
- Parameter Name: CustomerGauge Webhook (or any text)
- Sequence Number: accept the default else any number
- In the “Authentication Parameters”, click the “Add” button twice
- Parameter 1
- Name: Username
- Value: <Insert the CustomerGauge webhook username from the Step 1>
- Parameter 2
- Name: Password
- Value: <Insert the CustomerGauge webhook password from the Step 1>
- Save
- Go to the “Custom Headers” section. Create new “Headers”
- Name: Authorization
- Value: <for the value part, use the below formula>
- {!'Basic ' & BASE64ENCODE(BLOB($Credential.externalCredentialName.Username & ':' & $Credential.externalCredentialName.Password))}
- Do change the “externalCredentialName” with the name of the External Credentials setup. In this case, the name of the external credentials is CustomerGauge_External_Credential, so the final value to insert is
- {!'Basic ' & BASE64ENCODE(BLOB($Credential.CustomerGauge_External_Credential.Username & ':' & $Credential.CustomerGauge_External_Credential.Password))}
- Save
- Go to the “Named Credentials” (Setup → Named Credentials)
- Create New
- Label: CustomerGauge Webhook Credentials
- URL: <Insert the CustomerGauge webhook URL from the Step 1>
- External Credential: CustomerGauge_External_Credential (from step 2b)
- Generate Authorization Header: Unchecked
- Allow Formulas in HTTP Header: Checked
- Go back to the “Permission Sets” section (Setup → Permission Sets”)
- Under the Apps section, click the “External Credential Principal Access"
- Add the external credentials set up above to the right hand box
- Set up the “Flow”
- Go to “Setup → Process Automation → Flows”
- Create New Flow, and follow the steps below:
- In the dialog box, select the “Create from Scratch” and click “Next”
- In the “Select Type” dialog box, select the “Record Triggered Flow” and press “Create”
- Start Configuration
- Notes:
- Object: Select the object to initiate the flow. In this case, we want to trigger a webhook call when a contact is updated, so we use “Contact” object
- Configure trigger: A record is updated
- Condition Requirements: All conditions are met (AND)
- Specify the field of the object and the criteria that should trigger the call
- When to Run the Flow for Updated Records: Only when a record is updated to meet the condition requirements
- Select “Actions and Related Fields”
- Check the “Include a Run Asynchronously path…”
- Add new Element by clicking the “Plus” sign below the “Run Asynchronously” path. Select “Action” under the “Interaction” section
- In the Action dialog box, click the “Create HTTP Callout” button
- Setup HTTP Callout
- Name: CallingCustomerGaugeWebhook (or any - no space)
- Named Credential: CustomerGauge Webhook Credentials
- Press Next
- Configure Invocable Action
- Label: TriggerWebhook (or any)
- Method: PUT
- Press Next
- JSON Request - This will depend on the mapping setup in CustomerGauge webhook (step 1). For simplicity this is the example
{“Email” : “test@customergauge.com”} - Press “Review” and Click “Next”
- Select Sample Response Method: Use Example Response. Press “Next” and “Save”
- Action Configurations:
- Label: Action_TriggerCustomerGaugeWebhook (or any)
- Set Request Body
- In the “Value” part, click “Add new Resource”
- API Name: CustomerGauge_Webhook_Variables
- Press Done
- Add new Element, above the “Action” Element
- Under the “Logic” section, click “Assignment”. This is the part where you setup the value to send to CustomerGauge
- Label: Set Webhook Variables
- Set Variable Values
- Variable
- Under the “Apex-Defined Variables”, click the arrow next to the “CustomerGauge_Webhook_Variables”
- Select “Email” (as we want to set the Email variables”
- Operator: Equals
- Value
- Under “Global Variables”, click the arrow next to the “Triggering Contact”
- Select “Email”
- Save and Activate the Flow - Done!