Adding "and" before the last item of a series of embedded data in piped text | XM Community
Skip to main content

Hi everyone,
We have a survey that includes some questions in the format of:

  1. Did you lose interest in doing things you used to enjoy? (yes/no/don't know)

  2. Did you feel cut-off from other people? (yes/no/don't know)

  3. Did you have trouble remembering things? (yes/no/don't know)

Etc.
After these sets of questions, there's a follow-up question in the format of:
5. You said that you (keyphrases where 'yes' was selected). How long has this been happening?
Right now we've put the first set of questions each in their own block, with a condition in the survey flow that saves an embedded data value with the 'keyphrase' if 'yes' is selected. We then pipe these into the follow-up question as [keyphrase Q1][keyphrase Q2][keyphrase Q3].
We were wondering if it'd be possible to dynamically add the word "and" before the last keyphrase. So for example, someone who selected 'yes' for Q1, Q2, and Q3 should have the question formatted as:
5. You said that you lost interest in doing things, felt cut-off, and had trouble remembering things. How long has this been happening?
However, this is how it's currently formatted:
5. You said that you lost interest in doing things, felt cut-off, had trouble remembering things. How long has this been happening?
Any advice would be very much appreciated, thanks in advance!

One of the solution can be:
Create three embedded data (ED_Q1, ED_Q2, ED_Q3), one for each yes/ no question. Now after all these yes/ no question in survey flow check using branch logic, which phrase to pipe in "ED_Q1" , "ED_Q2" , "ED_Q3". While piping these embedded data in question 5, we will pipe it as -
You said that you ${e://Field/ED_Q1}, ${e://Field/ED_Q2} and ${e://Field/ED_Q3}. How long has this been happening?


https://www.qualtrics.com/community/discussion/comment/29840#Comment_29840Thanks for your response! If I'm interpreting correctly, that's similar to our current solution - however, if a respondent does not answer 'yes' for Q3, that formatting makes Q5 look like this:

You said that you lost interest in doing things, felt cut-off, and. How long has this been happening?

We'd like to format it such that we list the key phrases for whichever ones they select 'yes' to appear but the last key phrase should be preceded by an "and".


Leave a Reply