Assigning set of values to choices based on data | XM Community
Solved

Assigning set of values to choices based on data


Badge

Quite new to Qualtrics, but I've searched around and can't find an answer for this.
In my survey, one of the first questions is selecting a name from a drop-down. When this is done, I would like to set three predetermined values in the survey data based on the name (e.g. by selecting a particular name, fields A B C would be populated with values X Y Z and so forth) for further data analysis after the survey.
This would be relatively simple to do through survey flow, branching and embedded data, were it just one value, and I have tested that it indeed works well (if name is John, set embedded data A = X, B = Y and C = Z - repeat for all names with their corresponding set of values).
The issue is that I have 20+ choices in this question (with possibly more to come), and each choice corresponds to a different combination of three fields. Were I to do this manually, it would result in 20+ branches from that one question.
Is there a way for me to do this mapping of values in a simpler way? The 'Add from Contacts' option doesn't work, as I don't have any contacts nor the option to create them. I imported the Excel spreadsheet into Qualtrics but cannot find a way to use the data in the survey flow to assign values to names.
Apologies if the explanation is not clear enough, I'll try to clarify if necessary.

icon

Best answer by CarolK 2 June 2022, 15:40

View original

5 replies

Userlevel 4
Badge +23

Hi sjoel ,
Just trying to understand the query here, how are you planning to distribute the survey?
Is it anonymous survey or you are rolling out through emails.

Badge

Hi,
the survey will be distributed through an anonymous link. Choosing a name is simply choosing a person to evaluate, and the idea is to have the survey data enriched by certain attributes related to each person.

Userlevel 7
Badge +37

Based on your use case, I am thinking the survey flow method may be the best option available. I realize that is cumbersome of course.
I would consider throwing the entire process inside a "Group" step (so that you can collapse them when you're done, to make it easier to navigate other portions of your survey flow) -- and of course Duplicate/Edit will be helpful to you here rather than building each step individually.
I'll be interested if someone else has a better solution, though.

Userlevel 7
Badge +27

Hi there, I think I would also go the Survey Flow route here. I've also used a version of the below in the past, setting Embedded Data with JS on page submit based on a question selection. Adding the below to the bottom of the question's JS, updating the embedded data field as needed once it is set at the top of the Survey Flow:
Qualtrics.SurveyEngine.addOnPageSubmit(function (type) { // To record the selection when the page is submitted

if (type == "next") {

var selChoice = this.getSelectedChoices();

      // Set Embedded Data
       
if (selChoice == 1) {
Qualtrics.SurveyEngine.setEmbeddedData("TESTfield", "1")};

if (selChoice == 2) {
Qualtrics.SurveyEngine.setEmbeddedData("TESTfield", "2")};

if (selChoice == 3) {
Qualtrics.SurveyEngine.setEmbeddedData("TESTfield", "3")};

if (selChoice == 4) {
Qualtrics.SurveyEngine.setEmbeddedData("TESTfield", "4")};

}
});

Badge

Thanks Carol and Tom for the input!
Ended up doing this through Survey Flow and it worked just fine with a bit of manual work. I had initially overlooked the Group step, so that was helpful in making the flow a bit tidier.
I could also see the JS method being useful for similar applications, so I'll most definitely keep that in mind.

Leave a Reply