Hello everyone,
I'm fairly new to qualtrics and javascript and I was hoping you could help me to pull a value from a side-by-side into javascript.
I have a side-by-side with 5 rows. Each rows has a radiobutton in column 2, which requires participants to choose either 'yes' or 'no' (see image below)
I want to use javascript to calculate how often the respondent chose 'Yes', how often 'No' and how often they chose nothing at all (the question is not mandatory).
I've tried to refer to the selected answer in row 1, column 2 with piped text like this: ${q://QID71%232/ChoiceGroup/SelectedAnswers/1}, but that doesn't return anything, it seems.
thanks for your help!
Hi, You can use below piped text to get for which statements "Ja" was selected. Similarly you can get for which statements "Nee" was selected. And then using simple JS code you can get count of each choices.
${q://QID71%232/ChoiceGroup/SelectedChoicesForAnswer/1} - for 'Ja'
${q://QID71%232/ChoiceGroup/SelectedChoicesForAnswer/2} - for 'Nee'
You could do so using branch logic in the survey flow. It might be more involved than js, but it would be out of the box. You would just have to have an IF statement and a counter for each item.
https://community.qualtrics.com/XMcommunity/discussion/comment/40850#Comment_40850that seems to work, thanks!
https://community.qualtrics.com/XMcommunity/discussion/comment/40854#Comment_40854thanks, I think I see what you mean; if it doesn't work out with the JS I'll give it a try.
Hi JVR Please try piping like image below into the next question text so that you know if it shows up and then you can try getting it using JS.
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.