JS for dynamically displaying Row labels based on column selections in side by side Q | XM Community
Skip to main content
Question

JS for dynamically displaying Row labels based on column selections in side by side Q

  • October 16, 2025
  • 3 replies
  • 42 views

MargaretW
Level 2 ●●
Forum|alt.badge.img+5

Hey folks.  I am not a dev, but I  do poke around with code. I have a side by side question with several rows and three columns. Each column represents a yes or no question about the row label.  I want one follow up per column that will pipe the text of any row label for which a person selects “no” in the question. I’ve been trying to do this with a combination of embedded data and JS. But it always fails to pass any embedded value. Even passing a generic test value from the side by side question block to the block with the follow up question fails. I’ve checked silly things like embedded data field values and survey flow, but I cannot get this to work.  Any clues on the issue? I’d like to use JS to do this if possible because I will have several side by side Qs like this that need follow ups for the no values only. It would be super nice to reference those values directly in the follow up. Happy to share a screen short of my code. Thanks.

3 replies

  • Level 4 ●●●●
  • 275 replies
  • October 21, 2025

If possible, can you send me screenshots of the question. Send multiple screenshots if possible.


MargaretW
Level 2 ●●
Forum|alt.badge.img+5
  • Author
  • Level 2 ●●
  • 18 replies
  • October 21, 2025

Hi JBK, 

I actually figured out how to do something with Java Script as outlined in this post. However, I cannot get the values on the left of the table to appear as a bulleted list due to the internal commas in my variable. I tried the suggestion in the reply to that post, but that did not work. 


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6084 replies
  • October 21, 2025

Format row labels like this:

CS.U.1 Explain the electrical,​ optical,​ and bandgap...

In your JS:

str.split(", ");