SalesForce.com Integration Tutorial
We’ve been getting a lot of interest lately in our SalesForce.com module, which is basically just a custom implementation of our API. This tutorial covers the operations you can do with SalesForce as well as special things you should keep in mind when using it.
- Load SalesForce data into your survey
- Format a Survey URL to Load a SalesForce Record
- Taking Advantage of Email Invites
- Create or update SalesForce records with data in your survey
Our SalesForce Integration is in the form of an Integration Module that uses SalesForce’s XML API. It’s all encapsulated so you don’t need to do any coding.
From your Accounts->API Tab, you just need to supply SurveyGizmo with a SalesForce username, password to access your account. Here’s a screen shot:

Load SalesForce data into your survey
Once you add that information, a new action will appear for use in your surveys when you click Add actions in the survey editor: SalesForce Integration.

From here you can choose to populate the survey from SalesForce, update existing SalesForce records, or create new SalesForce records in your SalesForce account. You can do this to any SalesForce object, including custom objects. In the screenshot above we are choosing to load a SalesForce contact record into our survey.
Next we need to tell SalesForce which record to load. This is typically done from a url query string parameter, which you will add to the survey url when you publish it (see below). You can also do it from a hidden field in your survey or in an email invite field. Here we are using the merge code wizard to select “URL parameter,” then replacing “XXX” with “cid” as the merge code wizard indicates.

Now all we need to do is to map the fields from SalesForce to corresponding questions in our survey. (This is directly below the section in the screen shot above.)

Format a Survey URL to Load a SalesForce Record
When it comes time to deploy your survey, you will need to configure your survey url to match how you set it up in the section above. First, you’ll want to get the standard url from the Publishing tab for your survey.

Next, append a question mark, the parameter name that you specified in the step above (”cid” in our case) and an equals sign.
http://acme.salesforce.sgizmo.com?cid=
Here’s where it gets interesting. You will need to add the correct contact id for the person you are sending this url to, so how you do it will depend on what system you use. In many email marketing and content management systems, it will be a merge code that looks something like this:
http://acme.salesforce.sgizmo.com?cid=[%%some_field_name%%]
Check the documentation for your product to get the exact merge code.
Taking Advantage of Email Invites
If you uploaded your contacts to our Email Invite system, you can include the SalesForce contact id as a custom field and use that to load the record instead of a url parameter.

Create or Update Records in SalesForce
Creating or updating a record in SalesForce is essentially the reverse of loading. As you can see, the fields on the left are your survey questions, and you map them to SalesForce the way you did the reverse in the load action.

2 Comments
[…] Online FYI, this is just a quick note to let you know we’ve added a new section about SalesForce integration to our tutorials. For more Information Click […]
RE: Updating SalesForce Record
Hi Derek,
In my contact on SalesForce, there’s a unique identifier code that we use to identify the contact. When I use this identifier to map the data from SurveyGizmo to SalesForce, it hasn’t worked. What am I doing wrong?
select * from Contact where UID__c = ‘[%%738:Your ID %%]’
Followed by the variable mappings illustrated above.
Thanks!