Hi Community,
I am doing a survey using Survey123 app and aggregating the data through Xlsx. I have the following situation and have not been able to solve it:
I have several questions that should only pop up other questions if the user answers YES and if they answer NO they should skip them and go to the next one.
I am trying to use the following function but it is not clear to me how to use it:
if(selected(${question_one}, 'yes') and selected(${question_two}, 'yes'), 'yes', 'no')
Has anyone tried something similar that can give me a hint on how to do it.
Thanks, sincerely confused.
Translated with www.DeepL.com/Translator (free version)
Is this for the relevant column? You did not say. If so it just needs to eval to true so just this works.
selected(${question_one}, 'yes') and selected(${question_two}, 'yes')
Correct Doug and I'm sorry I did not say it. It is to be used in the relevant Column,
By now I'm trying this:
But it says the following "There has been a problem trying to replace --- with the Xpath... There is no survey element with this name
Not sure where you got that syntax, that is not even 123 code. What I posted should work.
If you're just trying to conditionally hide fields, you would put the expression in either the relevant or the body::esri:visible column. I recommend reading this blog post for more info on the nuances between the two columns. 🙂
The syntax would be something like:
${question1} = "Yes"
or
${question1} = "Yes" and ${question2} = "Yes"
With the expression you have in your original question, that syntax would be used in the Calculate column and would return the value "Yes" or "No" into that question based on answers from previous questions.
Hope that helps!