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

Conditional Text Insert or Piping

  • March 7, 2022
  • 8 replies
  • 1680 views

Forum|alt.badge.img+1

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...")

8 replies

InessaG
Level 5 ●●●●●
Forum|alt.badge.img+19
  • Level 5 ●●●●●
  • March 7, 2022

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.


Forum|alt.badge.img+1
  • Author
  • March 7, 2022

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?


InessaG
Level 5 ●●●●●
Forum|alt.badge.img+19
  • Level 5 ●●●●●
  • March 7, 2022

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.


Forum|alt.badge.img+1
  • Author
  • March 7, 2022

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..."}


InessaG
Level 5 ●●●●●
Forum|alt.badge.img+19
  • Level 5 ●●●●●
  • March 7, 2022

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.


Forum|alt.badge.img+1
  • Author
  • March 7, 2022

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.


InessaG
Level 5 ●●●●●
Forum|alt.badge.img+19
  • Level 5 ●●●●●
  • March 7, 2022

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.


Forum|alt.badge.img+1
  • Author
  • March 7, 2022

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.