Fetch Files - Pulling Customer Data Into the Survey

Fetch files are used to populate a survey from an outside data source. Fetch files give you an excellent way to customize your survey for respondents if you know something about them ahead of time and want to use this information in the survey.

The steps to using Fetch files are as follows:

Format a Fetch File 

The Fetch File must be a CSV file and should be formatted as follows: 

Each record in the file you are uploading has a password that matches the password used in the survey. This password is the key that links the two records together. 

Please note this helpful information regarding the format of the file: 

Uploading the Fetch File to SurveyWriter

To upload a Fetch file to SurveyWriter, do the following:

  1. Click Survey Options > Upload Fetch File.
  2. Click Browse and select the CSV file from your local drive.
  3. Choose whether to append the records to your project or replace any existing records with the Fetch file you are currently uploading.
  4. Click Save.

Inserting Variables into the Survey

To pull data from the Fetch file, use the variable insert function. In SurveyWriter, a variable is anything that is placed between two horizontal bar characters ( | ).

To pull data from field A1,  insert the variable |FETCH(A1)| into the text of your survey. To locate the respondent data, the Fetch function uses the respondent password and displays information from that row. 

For example, if in Field A1 you have the item the respondent purchased, you might type the following in the Question Text:

Last month you purchased |FETCH(A1)|. Please tell us how satisfied you were with this purchase.

Additional Fetch File Examples

Because of the flexibility of SurveyWriter, you can handle many advanced functions with a Fetch file. In the following example, a Fetch file is used to randomize text concepts too large to fit into a Sort Question.

Use a Fetch File to Randomize Text Concepts too Large to fit into a Sort Question

Often in your surveys, you will insert text-based concepts into a Sort Function question to have them randomized and presented in a follow-up question. However, the maximum number of characters that the Sort Question can hold and display in the follow-up question is 500 characters. An easy solution to this limitation is to present your long text-based concepts as images. If this solution does not apply to you, you can use a Fetch file to pull all the text related to your concept from the Fetch file.

This example shows two types of questions. The first example shows how to display one random concept from five available concepts. The second example shows how to display five concepts in random order in a follow-up branching question. Both methods pull data from a Fetch file.

Build Your Fetch File

In SurveyWriter, Fetch files are used to pull in data from an outside data source. In this case, we are pulling text into the survey. 

  1. Use Excel to build your Fetch file and save it as a CSV file. 
  2. In Column A, type the heading password. This is required in the first column of a Fetch file.
  3. In Column B, type the heading A1.
  4. In Column A, beneath the password heading, number the concepts you intend to show in your survey, for example, 1 to 5.
  5. In Column B, beneath A1, paste the text that makes up your concepts. The text can be any length desired. In this example, we have HTML tags such <B> for bold and <BR> for line break to illustrate how to format the text in the Fetch file if that is something you want.

Fetch File

A B
password a1
1 <B>Concept #1</B><BR><BR>This product...
2 <B>Concept #2</B><BR><BR>This product...
3 <B>Concept #3</B><BR><BR>This product...
4 <B>Concept #4</B><BR><BR>This product...
5 <B>Concept #5</B><BR><BR>This product...
  1. Use Survey Options > Upload Fetch File to select the Fetch file from your local drive and upload it to a project in SurveyWriter.

Show One Random Concept

  1. To show one random concept in a follow-up question, first build a Random Value function question. Make the range of this question 1 to 5. Name the function question Frandom.

  1. In the follow-up question, use the following syntax in the question text to pull in the concepts:

The variable insert statement in this example, |FETCH(A1,Frandom)|, is composed of the following parts:

Syntax Explanation

| | =
 

Enclosing question IDs or Fetch statements in the bar characters indicates that we are dynamically inserting text from an outside source into the question.

FETCH =

Indicates that we are inserting data from a Fetch file.

(A1,Frandom) =

 

A1 indicates that we are pulling data from column A1 in the Fetch file. Because we have included a question ID next to the column number, SurveyWriter substitutes the result from the question Frandom in place of a regular password to indicate the row from which to take data in A1. If the question Frandom returns a 3, data is pulled from the Fetch file from A1, Row 3 (in this example, Concept 3).

Show Multiple Concepts in Random Order

  1. To show five random concepts in a follow-up branching question, first build a Sort function question.

    Because you are simply introducing concepts and not pulling them from another question, enter 1 to 5 in both the Insert Answers field and the Value to Generate field as shown below.

    Make sure to select Random 5 in the Select Rank dropdown menu. 

 

  1. Enter your answer options 1 through 5 as well.

  1. Make the follow-up question a branching question with FSort as the branch parent. Select 5 as the number of branches and click the Last Branch Question to indicate that no additional branch questions follow this one.

  1. In the question text of the follow-up question, use the following syntax in the question text to pull in the concepts:

The variable insert statement, \FETCH(A1,pw=|)\, is composed of the following parts:

Syntax Explanation

\ \ =
 

Enclosing question IDs or Fetch statements in the backslash characters indicates that we are dynamically inserting text from an outside source into a branching question that already contains the symbol |.

FETCH =

Indicates that we are inserting data from a Fetch file.

(A1,pw=|) =

 

A1 indicates that we are pulling data from column A1 in the Fetch file. 

PW=| indicates that we want SurveyWriter to substitute the result from the branch parent question, in this case FSort, in place of a regular password to indicate the row from which to take data in A1. If the question FSort returns a 3 for the first branch, data is pulled from the Fetch file from A1, Row 3 (in this example, Concept 3).

In this example, SurveyWriter displays all five concepts from FSort in random order in the question text of the follow-up question.

Bulk Fetch

Bulk Fetch is used to pull in multiple Response Codes simultaneously from a fetch file for use in the answer options of a single question. The format is as follows:

|FETCH(A1,BULK,Frandom)|

The syntax to store multiple variables in a single cell in your fetch file is:

1::Male~2::Female~3::No Answer

1:: = Answer Code

Male = Answer Label

~ = Separates answers