Pipe in a specific words in a question based on response in a previous question | XM Community
Skip to main content

Pipe in a specific words in a question based on response in a previous question.

 

Q1 - Select a color?

Answer choices (single choice) - Green, Yellow, Blue

Note: If green is selected next question should pipe in ‘ABC’,

If yellow is selected next question should pipe in ‘DEF’, and

If Blue is selected next question should pipe in ’GHI’

 

Q2 - Why did you bought this {piped in word} car.

Example: If Green was selected, next question would be -- Why did you bought this ABC car.

 

How to create Question 2 without creating multiple questions with piped in values.

@TomG Could you provide an insight on this, Tom


Hi @Arunaj91 you can manage this with embedded data and branch logic in the survey flow.
 

Create a color mcq question.
Create embedded data (you can name it anything as per your wish) using suitable branch logic.
Pipe text the embedded data created in the survey flow. Make sure both these questions are in different blocks.

 


Thank you so much 


@Arunaj91,

There are three ways to do this:

  1. Use survey flow logic to set an embedded data field as @omkarkewat outlined. Works fine as long as it isn’t in a loop or you don’t care about being able to use the Back button.
  2. Set the embedded data field in the addOnPageSubmit JS function.
  3. Put the original and piped versions in <span> tags with classes and use JS to hide and/or show them as needed. This works well if the piped versions are derivative or shortened versions of the originals.

Thank you Tom and Omkarkewat. This is very helpful.


Leave a Reply