Conditional Text Insert or Piping | XM Community
Skip to main content

Hello all,
I am working on a survey for a client where either the parent or the child will be the respondent. This is achieved through a screener question where I will then populate an embedded data item called RTYPE (1=Parent, 2=Child).
After establishing the RTYPE, the question labels will vary depending on the value. In the event where the respondent is a parent, the question will be something like, "Please tell us how YOUR CHILD..." whereas if the respondent is the child, it would be, "Please tell us how YOU..."
The problem is the client has requested that only ONE question be programmed to fit both scenarios. I thought of doing this by creating a dummy question that will be used to pipe-in the appropriate text, but imagine having to do this for 50+ questions...
Is there another simpler way to do this? I have experience working with other survey platforms where you can insert text inline using Python or another programming language (i.e. "Please tell us how your child..." if RTYPE=1 else "Please tell us how you...")

You can set an embedded data field (e.g. "Display RTYPE"), and set it through branching in your Survey Flow to equal "YOUR CHILD" if your RTYPE = Parent, and "YOU" if it's not.
Then within the questions that follow up, you'd just pipe in the "Display RTYPE" variable and it will display the appropriate value.


I can see this as an option if I had a short survey. However, my survey is 50+ questions. Also, I forgot to mention that my survey is bilingual (English and French) so using a method of piping the value of an embedded data field will create A LOT of extra work. Do you have any other suggestions?


Other than creating 2 sets of variables or the two languages and piping in the appropriate one in your translation, nope - no other ideas. The value has to come somewhere.


And Qualtrics does not offer an option to perform this inline using some form of a scripting language? Something like:
${"Please tell us how your child..." if RTYPE=1 else "Please tell us how you..."}


That's out of my expertise. But not sure how this is different than inserting this script for each question vs. piping in a variable.


It would be quicker for me to hard-code the text variances directly in the question label. Using an embedded data field would require a long survey flow branching structure (if Parent and English, if Parent and French, if Child and English, if Child and French) for each and every one of the 50+ questions. I could go the route of using variables as I mentioned, but again I would have to create 50+ variables, one for each question. I was just wondering if there's a quicker way.


no, it wouldn't. You have to branch just once to set each variable. That variable would be the text you want to appear within the questions. Within the questions themselves, all you're doing is piping in the value of those 2 variable (one for English and one for French). No additional branching/logic.


My apologies, you're right. I'm probably overcomplicating this. I'm still new to Qualtrics and in the mindset of approaching this as I would with other survey tools I am more familiar with.


Leave a Reply