Creating a Conditional output in Piped text | XM Community
Skip to main content

Hi guys.
I am new to JS and to this community. I am looking for some help on the below issue:
I am using a matrix>bipolar to set up a 6 point scale that ranges from strongly prefer Candidate A (1), somewhat prefer Candidate A (2), slightly prefer A (3), slightly prefer B, (4) somewhat prefer B (5), strongly prefer B (6).
Based on the participant's response, I want to display the following text on the next screen. 'You chose Candidate A.'.
Piped text does not work nicely with matrix bipolar options and the maximum I could do is to display the recode value of the selected option. i.e., if they choose 'slightly prefer candidate A' then I can display '3'.
Is there a way for me to use JS and embedded data to display Candidate A if they chose 1,2, or 3 OR display Candidate B if they chose 4,5 or 6?

Be the first to reply!

Leave a Reply