How to use a CSV-file to create a custom survey path | XM Community
Question

How to use a CSV-file to create a custom survey path

  • 25 March 2024
  • 4 replies
  • 50 views

Badge +1

I want to create a survey where respondents enter their given masters degree and are later provided income information. There are two steps, and I am already struggling on the first:

  1. Selecting education
  2. Providing income data

On 1: I am sending a survey to all Danish university students. There are 600 different masters. Therefore, I want some steps

Select type of education (university, vocational) → select institution (Copenhagen, Aarhus etc) → select education (Political Science, Economics etc)

I want to embed a csv file where question options are pulled from. I’ve added a snippet here to show the five columns of interest. I saw this discussion which was close to the desired goal, but not completely it. I gather I need to write a Javascript. How do I - logically and technically - achieve this in Qualtrics?

On 2: This is a surveyexperiment, so half of the respondents will receive information on the given income one can expect with their education. How do I embed the income information (from the CSV) to a given respondent?

Thanks in advance for any suggestions. So far, I’ve uploaded the csv as a library, and I’m trying to understand how to make this simple snippet work.


4 replies

Userlevel 7
Badge +36

@MarcSH 

I believe the first step should be fairly simple (if its just Select type of education (university, vocational) → select institution (Copenhagen, Aarhus etc) → select education (Political Science, Economics etc)) where you use Drilldown question type and upload your csv (max 100mb). This will help you in selecting the education.

For second step, there is a feature called supplemental data (paid feature) if for every unique choice you can create an ID and on the back end use supplemental data to call it. You can show the income as well.

Another option would be to write JS and call the file from Library then filter it with required options and then show the income.

Hope this helps!

Badge +1

Thanks Deepak, that helps a lot!

I got the first part sorted, but I am having problems on the later. I do have a function called supplemental data, but it seems that I can’t upload csv’s to it. I am neither able to upload resources as supplemental data.

What I am trying now is to “hide” the drilldown option 4 (income info) from the respondent, but not from qualtrics. I can hide it, but then, the respondent is not able to see it… 

The method I am using now, in an effort to target the drilldown is:

Qualtrics.SurveyEngine.addOnReady(function() {

var questionContainer = this.getQuestionContainer();

var selectBox = questionContainer.querySelector('#QR\\~QID34\\~4');

if (selectBox) { selectBox.style.position = 'absolute'; selectBox.style.left = '-9999px'; } var labelForSelectBox = questionContainer.querySelector('label[for="QR\\~QID34\\~4"]');

if (labelForSelectBox) { labelForSelectBox.style.position = 'absolute'; labelForSelectBox.style.left = '-9999px'; } });

This moves it out of the picture in the drilldown, but then also removes it from the picture in the info. 

 

I’ve attached some screens. The first shows the information I want to hide and the second shows the information I want to keep.

 

Userlevel 7
Badge +36

@MarcSH 

Great to hear you got first part working.

Yes, you are correct if you hide the income information it wouldn’t be shown on next screen as it’s not selected.

Hence, what I was thinking is based on the 3 choices they make in drilldown you make a unique combination in an embedded data and keep the same unique combination in csv file. From the survey flow you can use supplemental data use that unique ID to capture income info.

Additionally, you can upload csv as source in Supplemental data.

 

Other option would be to autoselect 4th option via Javascript based on choices.

Hope this helps!

 

Badge +1

Thanks a lot, definitely does, but still struggling. My account is apparently semi-premium, so I don’t have access to embedded data, but I am trying to work around with javascript - with mixed succes. 

Leave a Reply