survey to randomly choose and list user provided dog names with loop & merge | XM Community
Skip to main content

Hi Community.  Suspect (hope) this will be an easy solve for some of you.  I’m struggling so would greatly appreciate the help.

 

I'm putting together a survey for dog owners.  Part of the survey allows them to answer a set of questions for each of their dogs (ie. if they have 4 dogs they would answer those set of questions 4 different times).  Recognizing that people may have more dogs than they are willing to answer questions about, I want the survey to randomly select which of the dogs they answer questions about first, second, and so on.  This will mean I’ll need the respondent to provide the names of their dogs so the survey can prompt them as to which dog to answer the questions about.  I also want them to be able to exit that part of the survey after answering for a specific dog (e.g., have 4 dogs but completed the survey for 3 and would like to move on).  Here’s what I’ve done and where I’m running into problems.

I asked how many dogs they have and have stored this as embedded data.  I then used this number with display logic to show the correct number to text boxes to gather the names of their dogs.  I have stored the names of each dog as embedded data (e.g., Dogname1, dogname2).

All of the questions I want asked for each dog are in a block.  I have added Loop & Merge to the block, having it loop on the dog names with randomization.

I think this is working.  I’m stuck on the final bit. 

  1. How do I get Qualtrics to list the dog name randomly chosen as piped text so the respondent knows which dog to provide info for?
  2. How do I provide a way for the respondent to opt out of answering about more of their dogs and move on to the next section of the survey? 

Thanks for any help!

 

Hi ​Jason,

 

  1. How do I get Qualtrics to list the dog name randomly chosen as piped text so the respondent knows which dog to provide info for?

Ans: You can decide this in loop & merge directly.

Other option is to add randomizer in survey flow to select randomly any 4 embedded fields (eg Dog1=1, Dog2=2, etc...) participant has answered and accordingly show those names matching with selected embedded fields from randomizer.

Alternatively, before your loop, ask participant to select their preference. Then, in your loop & merge setup, base the loop on the selected choices in your MC question. It gives option for participant to decide how many they want to answer without skipping.

  1. How do I provide a way for the respondent to opt out of answering about more of their dogs and move on to the next section of the survey? 

For this you can just ask one question to opt out of loop and then set embedded field using Qualtrics.SurveyEngine.setJSEmbeddedData and skip all remaining loops if in embedded data field opt out is selected.

 

Hope it helps!

 

Thanks,

Jagdish


Hi Jagdish.  Really appreciate the response and assistance.  Sorry if I missed it, is there a way to have the Loop & Merge randomly selected dog name inserted into piped text at the beginning of each loop so that the user knowns they are now giving info for which dog (e.g., Dog3)?  Then the next time through, piped text would insert the next randomly assigned dog name in that spot (e.g, Dog5)?

-Jason


Hi,

Base your L&M on your number of dogs question or ED, then set up your L&M like this. I piped in the answers to a form question, but it could be regular open-ended ones.

Then, in your loop question, you can pipe in the field 2 value with 

${lm://Field/2}

 


To get out of your loop, you could add a “do you want to continue” question at the end of your loop and add conditions on each of your loop question like this:

 


Hi Vincent.  Thank you!  This all worked perfectly.  Appreciate it.


Leave a Reply