Salesforce Triggers
Salesforce trigger events are specific occurrences or actions within the Salesforce platform that can initiate automated processes or workflows. These trigger events are essentially “triggers” that prompt Salesforce to execute predefined actions, such as updating records, sending notifications, or invoking external processes.
Your Surveyapp email survey can be configured to send an email survey on several Salesforce trigger events and capture valuable feedback on customer experience.
Automations can be set up to send an email survey on:
- Contact: Created: This trigger event occurs when a new contact record is added to the Salesforce database, either manually or through data import.
- Case: Created: This event is triggered when a new case (customer inquiry or support ticket) is created in Salesforce, indicating the start of a support process.
- Case Status: Closed: This trigger event occurs when a case is marked as closed, indicating that the issue or inquiry has been resolved to the satisfaction of the customer.
- Lead: Created: This event is triggered when a new lead (potential customer) record is added to Salesforce, typically representing a new sales opportunity.
- Lead Status: Closed – Converted: This trigger event occurs when a lead is converted into an account, contact, and optionally, an opportunity. It indicates successful conversion of a lead into a potential sales opportunity.
- Lead Status: Closed – Not Converted: This event is triggered when a lead is marked as closed without being converted into an account, contact, or opportunity. It may indicate that the lead is not a good fit for the sales pipeline at the moment.
- Opportunity Contact Role: Added: This trigger event occurs when a contact is associated with an opportunity in Salesforce, indicating their involvement in the sales process.
- Opportunity Stage: Closed – Won: This event is triggered when an opportunity reaches the “Closed – Won” stage, indicating that the sales deal associated with the opportunity has been successfully closed and won.
- Opportunity Stage: Closed – Lost: This trigger event occurs when an opportunity reaches the “Closed – Lost” stage, indicating that the sales deal associated with the opportunity has been lost or unsuccessful.
Prerequisites
- You have sign in credentials/ are signed in to your Salesforce instance.
- You have the necessary Salesforce privileges and have installed the Surveyapp CX cards package for Salesforce. (See link for installation: XXXX)
Connecting Salesforce
In Surveyapp web app (https://app.surveyapp.io), create your email survey.
On the Distributions step of the survey, click on the Send Email Survey tab.
Click on the Integrate tab
Now, click the Salesforce tab.
If you have already connected Saleforce with your Surveyapp account with a past automation, it will display your instance here and also the other automations connected to this Salesforce instance which you may have. In this case, please skip the below steps (1-6).
- Click “Add a Salesforce Connection”
- In the modal which opens, give your Salesforce Instance a name. E.g My Salesforce Instance.
- Tick if it is a Sandbox or Production Salesforce instance.
- Click Connect.
- A popup window will launch asking you to sign in to your SF instance, if you haven’t already.
- Once the Salesforce and Surveyapp handshake is complete, you will see your instance and its status under the Salesforce tab on the distribution> Integrations tab on Surveyapp.io.
To continue setting up your Email Automation, click Add an Email Automation
Set up your Email Automation
In this step, you will choose your Salesforce Trigger event. For the sake of an example, we will assume you wish to send an email survey whenever a case status changes to “Closed”. From the dialogue which opens up asking to choose a Salesforce Trigger Event, choose “Case Status: Closed”.
A Trigger Configuration section called CASE STATUS: CLOSED will be added to the Email Automations panel.
Give the Automation a name. E.g. Send Survey on Case Status: Closed
Leave the conditions blank if you wish to send the email survey each time the trigger event is met. Alternatively, you can create conditions to send the survey only if a certain set of conditions are met.
How to create conditions for your automation
You can create multiple conditions using the conditions builder, withe the AND or OR operator.
For example, suppose you would like to send the email survey on Case Status: Closed, only if the following two conditions are met:
The Case Priority is set to High
The Case Origin is set to Email
Click the + Add condition button to add your rule.
Set up the first condition: The Case Priority is set to High
From the left most dropdown, select Case Priority.
The options in the dropdown depend on the Salesforce Trigger event that the automation is being configured for. Different events have different options in the conditions builder.
From the middle dropdown, select your operator – Equal to. From the third dropdown, select the value, High.
Click + Add condition to add the second condition and similarly follow the above steps.
NOTE: AND and OR Logical Connectors: These combine multiple conditions into a single logical statement and determine how individual conditions are evaluated together. You may only use one type of logical connector between all your conditions. For example, your conditions can use either AND or OR, not both.
Send Email Survey To:
Choose whom to send the email survey to once the case has been closed.
TIP: If you are testing out Surveyapp on a Sandbox instance, add your email address in the Sandbox Recipient Email so that the email surveys will be redirected to the Sandbox Recipient Email address instead of the actual contacts.
TIP: You can configure different automations for the same survey, based on different Salesforce Tigger events. Simply click the Add an Email Automation again to add another automation.
Click on Distribute to save your Automation.
Now, in Salesforce, whenever an agent closes a case, an email will be sent to the customer automatically (provided any conditions set in the automation are met).
Close the feedback loop
“Closing the feedback loop” refers to the process of actively responding to, acknowledging, and taking action based on feedback received from customers, employees, or other stakeholders. It involves completing the cycle of communication by following up on feedback, addressing concerns, and implementing changes or improvements based on the received input.
Actions to close the feedback loop depend on the Salesforce Trigger event that the automation is being configured for. Different events have different feedback loop options.
With feedback loops, you can automate actions such as create new cases, update contact information and even start a Salesforce Flow on your Salesforce instance.
An Example
For example, we created an Email Automation to send an email survey on Case Status: Close, and we wish to add a Feedback Loop action where we would like the response of the survey to be added to the Case Feed in Salesforce.
The responses should only be added if both questions in the survey were answered.
To add the Feedback Loop action, click on the + Add Feedback Loop Action button.
From the pop-up which opens, select the feedback loop action – Update Case to configure:
Declare the conditions which will trigger the Feedback Loop action: The responses should only be added to the Case Feed if both questions in the survey were answered.
Click the + Add Condition button. From the drop-down, select the first question.
From the second dropdown, select the value “Is answered”.
Add the second condition (click the + Add condition button again) and similarly follow the above steps for the second question.
Lastly, you will need to configure the action – which is, to add comments to the Case Feed.
From the Choose Action Configuration Items box, select Add Comments to Case Feed.
You will now be able to configure what goes in the comments. Click the the Add Comments to Case Feed text box which opens up. Insert your text to add the context. You can pull up case, contact and account attributes along with responses from your surveys by simply typing the shortcode “{{“. This will bring up a context menu with all the values which can be added to field.
Click on Distribute to save your Feedback Action Loop.