Populating one survey with data from another is a fairly common need when running surveys over time. Say, for example, you ran a survey last year and this year you want to run that same survey with some additional questions.
For respondents who completed the survey last year you only want them to see the new questions. For new survey respondents who didn't complete the survey last year, you only want them to see the initial survey questions.
AND you want all the data in once place.
Let's cover the use case example that we'll be using in this tutorial so we're on the same page. Let's imagine the HR team at SurveyGizmo ran an employee hapiness survey last year. This year they wish to re-run the employee happiness survey in order to ask new, follow-up questions of employees who responded last year. For these returning respondents, they wish to have last years' data available in the same data file in order to analyze what aspects of employee happiness improved and what aspects did not.
In addition, because a whole year has gone by, there are a number of new employees that will need to answer the original survey questions. Again, the HR team wants to have this information in the same data file for analysis, so they want to use the same survey to collect responses from new employees.
In this tutorial, we'll walk you through one option for accomplishing these requirements: uploading data from a previous survey to an Email Campaign. This option supports uploading only 10 fields of data from your survey plus any contact data you wish to include, e.g. email address, first name, last name, etc. SurveyGizmo account admin users can, however, take advantage of Custom Fields in Email List if more than 10 fields are needed.
As with many things in SurveyGizmo, there are a number of different alternative pre-population options if these examples don't work for you.
Here is a quick overview of the set up for using an Email Campaign to preopulate a survey.
- Copy the previous survey and add follow-up questions.
- Export the raw data from the previous survey.
- Prepare the data file for upload to an Email Campaign in the new survey. File will include email address, up to 10 fields with data from your previous survey and any contact data you wish to use in the survey and the Email Campaign messages.
- Create an Email Campaign in the new survey, upload the data file and map data from previous survey into Invite Custom Fields 1-10.
- Set up the prepoulation in the survey using Merge Codes in the Default Answer field of questions.
- Set up logic to determine what questions/page returning and new respondents see.
- Send out Email Campaign invites to begin collecting data!
SurveyGizmo Features Used in This Walkthrough:
- CSV/Excel Export - For pulling previous survey's data.
- Email Campaigns - For pre-population. Learn about alternative pre-population options.
- Merge Codes - For pre-populating survey with previous survey's data.
- Default Answers - For pre-populating survey with previous survey's data.
- Page Logic - To control what questions are seen by the two groups of respondents.
1. Copy Previous Survey and Add Follow-Up Questions
We'll start by copying the previous survey and adding the follow-up questions we wish to ask of returning respondents.
It's best to have these follow-up questions on a page or pages that follow the previous survey's questions.
That's it for this step; we'll return to this survey later to set up the pre-population and logic.
2. Export the Raw Data from Previous Survey
Now, because we want the data from last years' responses, we need to export the data from last years' survey using the CSV/Excel option on the Export tab of last years' survey. Because we used an Email Campaign last year, we'll select the option to Include Email Invitation & Contact Fields.
If you did not use an Email Campaign for last year, don't fret. At a bare minimum, you need to know whose data is whose and, because in this example we are using an Email Campaign to pre-populate, you'll need to be able to tie it to an email address. If this doesn't work for you, check out our alternative pre-population options below.
3. Prepare the Data File to Upload to the New Survey
The data file we'll be using in our example is below. At a minimum you'll have each respondents' email address and, if they're returning respondents, their data from last year. For the Email Campaign pre-population method there is a max of 10 fields available for uploading and pre-populating. If this does not meet your needs, SurveyGizmo account admin users can create Custom Fields as part of our Email List feature. Or check out our Login/Password Pre-population method.
In our data file, we also uploaded first name and last name. For more information about what contact fields are available for upload, check out the Contact Data Reference section of this tutorial.
In addition to last years' contacts, we need to add all new employees to this data file as they will need to be invited to respond to the original survey questions. In our data file, we appended these contacts to the bottom of our contact list.
4. Upload Data File to an Email Campaign
With our data file ready, we're going to return to our new survey with the follow-up questions and create an Email Campaign.
For the purpose of pre-population the most important step of the Email Campaign set up is the contact upload, so we'll limit the coverage of Email Campaign set up to that. Want to learn more about setting up email campaigns? Check out our Send Your Survey Via Email Tutorial.
To get started adding contacts, we'll go to the Contacts tab of your Email Campaign, click Add Contacts > Upload Contacts > Choose a File... After browsing for our data file that we created in the previous step we'll click Upload.
Once our file is uploaded we'll need to map the fields in SurveyGizmo to the fields in our data file. We'll map email to email, and our other contact data we've uploaded e.g., first name, last name, etc. to its corresponding field in SurveyGizmo.
Then we'll map the survey data from our previous survey to Invite Custom Fields 1 through 10 at the bottom of the mapping list. Remember, for the Email Campaign pre-population method, there is a max of 10 fields available for uploading an pre-populating. If this does not meet your needs SurveyGizmo account admin users can create Custom Fields as part of our Email List feature. Or check out our Login/Password Pre-population method or other alternative options.
When we're finished mapping, we'll click Continue. Once our contacts are added we'll now have access the previous survey's data for each contact.
Let's take a look to confirm! On the Contacts section of our email campaign, we'll click on the contact to view all the details for that contact. Let's take a look at Worf, for example. If we scroll to the bottom of the Contact Info tab to the Invite Custom Fields for Worf, we can confirm that his previous survey data is present. That Worf, he's one tough customer; good thing we're doing a follow-up survey to see if we addressed his concerns!
So, now that we have the previous data uploaded, we just have to use it in the survey; that's our next step!
5. Set Up Pre-population
Now that we have the previous survey's data available for use within our survey, we can use it to pre-populate the original survey questions.
For each of our initial survey questions we want to pull the data we uploaded to the Email Campaign into our original survey questions. To do so, we'll edit each question and go to the Layout tab. Below the Default Answer field we'll use the Insert merge code link to reference our contact data in our survey.
For example, we uploaded the first question from last years' survey to Invite Custom Field 1 so, after clicking the Insert merge code link, we'll select this field in the dropdown that appears and click the Insert button. This will place the merge code for the Invite Custom Field 1 in the Default Answer field. This will then dynamically populate when there is data avaiable for a given contact. For new contacts, since there is no data, the field will remain blank.
We'll repeat this set up for each question in our survey we wish to pre-populate.
Reference: Merge Codes for Contact Data
Below is a list of each email campaign contact field and its corresponding merge code. These merge codes can be copied and pasted wherever you wish to pre-populate your survey with the data you've uploaded.
|Global Contact Fields||Global Contact Field Merge Codes||Custom Contact Fields||Custom Contact Fields Merge Codes|
|[contact("email")]||Invite Custom Field 1||[invite("custom 1")]|
|First Name||[contact("first name")]||Invite Custom Field 2||[invite("custom 2")]|
|Last Name||[contact("last name")]||Invite Custom Field 3||[invite("custom 3")]|
|Organization||[contact("organization")]||Invite Custom Field 4||[invite("custom 4")]|
|Department||[contact("department")]||Invite Custom Field 5||[invite("custom 5")]|
|Phone (Home)||[contact("home phone")]||Invite Custom Field 6||[invite("custom 6")]|
|Phone (Fax)||[contact("fax")]||Invite Custom Field 7||[invite("custom 7")]|
|Phone (Work)||[contact("work phone")]||Invite Custom Field 8||[invite("custom 8")]|
|Address||[contact("street")]||Invite Custom Field 9||[invite("custom 9")]|
|Suite/Apt||[contact("suite")]||Invite Custom Field 10||[invite("custom 10")]|
|Job Title||[contact("job title")]|
|Contact Custom Field||[contact("customfieldname")]|
6. Set Up Logic to Determine Which Questions Respondents See
The final step is to set up logic so that new respondents only see the original survey questions and returning respondents only see the follow-up questions. Before we jump into this though, it's good idea to test our pre-population to ensure that the data is present.
To do so, we'll copy our email campaign and upload a dummy contact with some dummy contact data and our email address. We'll then send ourselves the invite, click the link and confirm that all of our original survey questions from the previous survey are populating.
Once we've confirmed the pre-population is working we're ready to set up logic to determine who sees what questions. In our example, we want returning respondents to only see and answer the new follow-up questions added to the survey. We also want for new respondents to only see an answer the original survey questions.
To set up this type of logic it is easiest to have the original and follow-up questions on separate pages. There can be as many pages for each portion of the survey we just want to ensure that original and follow-up questions are not on the same page.
To set up the logic, we'll click the pencil icon above the page and go to the Logic tab. The easiest way to set up this logic is to use one of the Email Campaign Custom Fields. Because these fields are empty for new respondents, we can take advantage of this in the logic set up. In our example, we selected the very first Custom Field from our Email Campaign in the first dropdown menu and completed the logic by selecting the operator is not answered in the second dropdown menu. This logic setup means that when the Invite Custom Field 1 is blank the page will show, otherwise the page will not show.
For the follow-up survey questions we'll set up the inverse of this, since we only want returning respodents, whose Invite Custom Field 1 is answered or not empty.
7. Send Out Your Email Campaign Invites
Once we're finished setting up and testing our logic we're ready to send out our invites to the 2015 Employee Happiness Survey. On the Send Campaign section of our Email Campaign we'll click the Send Now button. This will send a unique link to each of our respondents which allows for the data from last year to pre-populate in this years' survey response.
Allow Returning Respondents to See/Edit Previous Responses
In some cases you might want to allow respondents to see and edit their answers. To set this up you might want to add a question asking returning respondents if they wish to review and edit their previous responses. You can then use this question to set up skip logic to jump the respondents who answered "no" straight to the new survey questions.
Or, if you wish to have all returning respondents review their previous answers, you can add a Text/Instruction Element to your survey explaining that the beginning of their survey will show the answers from last year which they can edit if they wish.
To do so, use the Merge Code tool on the editor toolbar of your Text/Instruction Element to pull from your Email Campaign where you've uploaded your previous surveys' data.
Below is how this would look for returning survey respondents.
Alternative Options for Pre-population
Using our Login/Password action, you can upload a CSV spreadsheet that contains a unique login and password for each of your contacts. In this spreadsheet you can include additional data for that contact for prepoulation in the survey. The Login/Password action works by associating a password to additional data contained in the rest of the columns for that row. Check out our Pre-populate Using the Login/Password Action Tutorial to learn more!
HTTP Connect and Other 3rd Party Integrations
Communicating with external systems, websites, or custom pages allows a unique method for pre-populating your survey by interacting with external databases of information, whether stored in one of our partner's websites or building a custom interaction to your own company. In almost all cases, you can also send data from the survey to populate the external databases as well! The following tutorials provide more information about 3rd Party integration:
- Salesforce Marketing Cloud Integration - Pre-populate subscriber information based on their Subscriber I
- Salesforce Integration - Pre-populate content based on a Salesforce query with a unique Contact ID
- HTTP Connect Action - Pre-populate with a returned url encoded string from a custom webpage and script
URL Variables are values that can be added to the end of the survey link that pass a name/value pair, such as "firstname=Derek." Within your surveys you can access and use values passed via query strings by using the [url("xxx")] merge code, which could look like the following: [url("firstname")]. This merge code would populate with whatever value ('Bob' in the above example) was passed in the "firstname" query string.