I asked this a while back to no avail and question came up again so I thought I'd try give it another try.
I'd like to make a question conditionally required, that is I would always like it to visible however if a previous question is answered a certain way I would like the question to be required. Does any one know if this is possible?
Here is a link to my original question: Survey 123 Conditionally Required Question
Solved! Go to Solution.
Has there been any progress for allowing this functionality in the Web form?
Chris Anderson
Florida Fish and Wildlife Conservation Commission
Hi. Yes. This has been implemented. Make sure you use Survey123 Connect version 3.11 or newer for this. This works in both the Survey123 field and web apps.
Attaching an XLSForm illustrating how this can be done.
type | name | label | required |
---|---|---|---|
select_one yes_no | nextrequired | Make next question required? | |
text | comments | Comments | selected(${nextrequired},"yes") |
Hi there,
I know this was from a while ago, but I was wondering if the ability to put a function in the required section has changed at all. I'm trying to do so, but it is only letting me pick yes or leave blank. I am on version 3.15.170 and I am just trying to make it so that the question isn't 'completed' until the value is = 100. Cheers!
Hi,
i have used this if statement in the required field: if (${Type_Suivi}='Elimination','yes',''), where Type_Suivi is a select_one question. I also have conditions in the relevant column for that same question. I am not getting a required question when using the form. The only way I can have this question required is when i remove the if statement and the relevant expression. Any clues?
The statement must evaluate to True not 'yes'. You can pull this off using 1 and 0.
Use this
if (${Type_Suivi}='Elimination',1,0)
Thanks Doug! Just had it working also using: ${Type_Suivi}='Elimination'
Opps I was writing Ifs all day so I forgot. Same though - evaluate to true.
How I use if in relevant is things like if(${state}="WA",${Type_Suivi}='Elimination',0). This is having a relevant only for certain situations.
Sorry about that
I really need the conditionally relevant feature, so definitely bump this up on your enhancement priorities.
Without knowing what workflows you're using, this method is one that I've tried with some success:
type | name | label | relevant | calculation |
---|---|---|---|---|
select_one yes_no | IsRequired | Should this question be required? | ||
text | NotRequired | This question is not required. | ${IsRequired}='no' | |
text | Required | This question is required.* | ${isRequired}='yes' | |
text | Result | This field stores the values of 'Required' and 'NotRequired' | if(selected(${IsRequired}, 'yes'), ${Required}, ${NotRequired}) |
Great work around Nick!!! Thanks for sharing, this will be a regular part of the workflow in many forms.