Here at Cloud Innovation, we’ve been looking for a survey-tool to integrate with our Salesforce Org. We want to be able to automatically send an email, including a survey link, to clients when a case is closed or a project goes live. This way we’re able to get feedback and improve our way of working. In this blog you will be able to find out how exactly we did this.

The survey-tool that we chose to use was Typeform, a very flexible survey-tool with a built-in integration with Salesforce. What we like the most about Typeform are the many customization options and the possibility to personalize your surveys. Before you start with the integration, you’re going to need a Salesforce license, a Typeform Premium Account and a survey form (more on that here).

The integration with Salesforce is mostly used to map the results from Typeform to Salesforce. Therefore you are able to view your survey responses directly in Salesforce. To integrate your Typeform with Salesforce and send out the survey through Salesforce, you’re going to have to go through five simple steps:

  1. Creating a custom object
  2. Configuring existing objects
  3. Creating a HTML email template
  4. Creating the automation
  5. Connecting your Typeform with Salesforce
     

Step 1: Creating a custom object

Creating a custom object isn’t always necessary, it depends on what you want to use your forms for. If you want to save all the results from your forms in Salesforce, then you will need a custom object.

After you’ve created the object, you’re going to need to add some fields. You have to create a field for every question in your survey. This way, you can later map every question of your survey with a field in the custom object. You’re also going to have to create a lookup field, but more on that later.

Besides the necessary fields, you can add whatever fields you prefer. We are going to add some lookup fields: Account, Contact, Case and Project. This way we will be able to identify who filled in the form, from which company this person is and for which case or project the survey was filled in.

 

Step 2: Configuring existing objects

We want to send out the survey link whenever a case is closed or a project goes live. So, we are going to have to add a formula(text) field to these objects. In this field we’re going to create the right URL for the clients to click on.

First you should copy the URL from your survey in Typeform. You can find the URL at the “Share” tab on your form.

The URL, for a project survey, might look something like this: "https://YourSubDomainName.typeform.com/to/XXXXXX?sfcn=" &  XXX & "&sfan="  XXX & "&sfcid="  XXX “&sfpn=” XXX “

The sfcn (Salesforce Contact Name), sfan (Salesforce Account Name), sfcid (Salesforce Contact Id) and sfpn (Salesforce Project Name) could be different for your survey, these are the hidden fields that we use. Next, in the formula field, insert the correct fields for your hidden fields. Our URL looks like this: "https://YourSubDomainName.typeform.com/to/XXXXXX?sfc=" &  Contact.LastName & "&sfa="  Account.Name & "&sfcid="  Id “&sfpn=” Project.Name

 

Step 3: Creating a HTML email template

Next you should create a new HTML email template or use an existing one. Make sure you insert the field, which you created in step 2, as a clickable word.

You can create a new email template by going to setup > Email templates > new Template. You can find more on creating HTML email templates here.

 

Step 4: Creating the automation

First, you’re going to have to create an email alert.  You can create an email alert by going to setup > Email Alerts > New Email Alert. You can find more on creating Email Alerts here.

Next, you’re going to use the email alert in the automation. For email alerts it's recommended to use Process Builder or Workflow. Both options work fine, we decided to use Process Builder.

We created two processes, the picture below shows an example of how the process of sending out a Case Closed Survey could look.

 

Step 5: Integrating Typeform with Salesforce

Now, everythings is ready to connect your Typeform with Salesforce. First, you have to install the Typeform app in Salesforce. You can do this by going to your form and clicking on the “Connect” tab and clicking once more on “Connect” next to Salesforce.

 

Once the app is installed, you have to create another field on the custom object which you created in the first step. It should be a lookup field to the “Typeform Form Mapping” object. Write the API-name from the field that you just created and from the custom object down and go to setup > home > Custom Metadata Types. Next, click “Manage Records” in the “Action” column next to “Typeform Target Object”. Then, click new and fill in the fields. Fill in the API- name of your custom object in “Object API Name” and fill in the API-Name of the custom field you just created in “Mapping Lookup Field”. Lastly, choose a label.

Next, you should set up the Typeform app. Open the Typeform app and go to the “Admin tab” > click “Get Started”. Once your Typeform account has been connected with Salesforce, you can start doing the mapping. Go to the tab “Typeform Forms”, click on the Form that you want to map, select “New Typeform Mapping”, select your custom object and click “Save & Create Mapping”. Now you should be able to map the questions and hidden fields from your form with the fields in your custom object.

In conclusion
So, that’s how you integrate Typeform with Salesforce! It can seem like a lot of work, but it’s actually super easy to do! If you’re still experiencing problems with the integration, I suggest reading “Salesforce Integration” and “Map your Typeform to any object in Salesforce (for advanced users)”.