Understand the flow of a survey when exporting survey questions through API | XM Community
Question

Understand the flow of a survey when exporting survey questions through API

  • 20 November 2019
  • 3 replies
  • 52 views

Userlevel 5
Badge +11
Hi All,

We are currently working out how best to export the Qualtrics data and import it into our data warehouse to allow further analysis. The exporting of responses is well documented via API but we've come across a number of things that don't seem possible. One area is it doesn't seem possible to understand the flow of the survey and the order in which the questions were answered. We're trying to capture the routing of the survey aswell as the survey questions and the response information and this is particularly important when you are using a non linear survey such as a table of contents.

Some ways to get round this include:
-Tag each question with its parent question by QID but this would be very manual and prone to error if the survey is changed.
-Time each question so that you can then work out the chronological order and from that understand the routing - but similarly to the Tag option, this might not work so well if a participant goes back to a question to change it.
-Work out how to translate the display logic, skip logic and survey flow branching information from the Survey export.

I’d be grateful for any guidance on best practise and some examples.

Thanks

Rod Pestell

3 replies

Userlevel 4
Badge +7
Hi @Rod_Pestell!

The typical best practice to tracking progress through the survey is to use embedded data fields to capture certain points along the way (screenshot 1).

!

However, as you have pointed out, this won't work for surveys using the Table of Contents feature where a respondent can skip from section to section. In this case, I would recommend adding Javascript to each question that will keep track of a respondent's path through the survey by appending the question number to a string stored in an embedded data variable. This will keep track of each question the respondent sees in their path through the survey (screenshot 2, 3).

!

```javascript
Qualtrics.SurveyEngine.addOnload(function()
{
//Javascript for splitting Time/Focus on Site
var path = "${e://Field/javascriptSurveyPath}";
var updatedPath = path + "," + "Q1"
Qualtrics.SurveyEngine.setEmbeddedData('javascriptSurveyPath', updatedPath);

});
```

The result is a list of values in the data set that can be used to derive the path taken through the survey (screenshot 4). In the example below, I completed the survey twice using different paths through the Table of Contents.

!

Let me know if you have any questions. I hope that helps!
Userlevel 5
Badge +11
@KierJ,

Thanks for the reply. I'll look into that but for a survey that is 100 questions or have even 200 questions that might be quite time consuming in adding all the java script. I guess the JavaScript could be made generic and record the QID.

So from the example "Start,Q2,Q3,Q4,Q5", you would know that the predecessor of Q5 was Q4 and also how many times Q4 was visited.

Do you think this code could be placed and made to work from the look and feel header?

Thanks

Rod
Userlevel 4
Badge +7
@Rod_Pestell that's a lot of survey questions! I've never tried what you're suggesting. Totally a guess, but my hunch is that it wouldn't work because the Look and Feel might be rendering separately from the survey flow logic.

Leave a Reply