Could somebody fix my crappy Java...please? | XM Community
Skip to main content
Solved

Could somebody fix my crappy Java...please?

  • August 15, 2021
  • 4 replies
  • 19 views

Forum|alt.badge.img+2

I have next to zero coding skills, I had an employee who applied some Java that magically removed the empty rows from a survey item but he quit now I need to do this again and I tried to use his code but it is cutting out the first row which is no bueno. Anyway, I would be eternally grateful if somebody can help. I have attached a lovely sreenshot.
Cheers!
rON
badJava.pdf

Best answer by ahmedA

You don't need JS for this. Just add display logic to individual choices.
image.png

4 replies

Forum|alt.badge.img+22
  • Level 7 ●●●●●●●
  • Answer
  • August 15, 2021

You don't need JS for this. Just add display logic to individual choices.
image.png


Forum|alt.badge.img+2
  • Author
  • August 16, 2021

Wow! That was much easier, thanks so much! But here's a tougher one at least for me... how do I only display an additional email field to be completed by a respondent when they need it instead of how I have it set up in the attached? I can't get the above method to work since there is no embedded data or other to use.
Capture.PNG


JeremyK
Level 3 ●●●
Forum|alt.badge.img+7
  • Level 3 ●●●
  • August 16, 2021

You could set this email problem up with a lead-in question asking "How many professors would you like an accommodation letter sent to?" This gives you the trigger you need for the question displayed. Your Display Logic would be statement-by-statement, driven by the answer from the lead-in question.
You could get fancier with a button in the question that increments an embedded data integer and drives your statement display logic dynamically, but that's way more complex and I don't think the juice is worth the squeeze in this case.
Any questions, let me know. I can probably mock something up for pretty quickly.


Forum|alt.badge.img+2
  • Author
  • August 16, 2021

Yep, I will probably go with the first option and keep it simple, great idea this forum rocks!