Make a question required conditionally based on answer to previous question

11907
23
Jump to solution
03-30-2017 08:07 AM
BrentKinal1
Occasional Contributor III

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

1 Solution

Accepted Solutions
IsmaelChivite
Esri Frequent Contributor

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.

typenamelabelrequired
select_one yes_nonextrequiredMake next question required?
textcommentsCommentsselected(${nextrequired},"yes")

View solution in original post

0 Kudos
23 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Brent,

Currently the relevant column doesn't support functions, so it isn't possible to have an optionally required question. We have it listed as an enhancement in our development queue and I'll add you request to the documentation for it.

BrentKinal1
Occasional Contributor III

Thank you James!

0 Kudos
KevinBrown10
New Contributor III

I also had this question and believe that adding that enhancement to require responses based on a previous question would be very beneficial and utilized on a majority of our surveys once available.  

Thank you and keep up the great work.

TimnaG
by
New Contributor II

Hi James, 

Is there any update on the status of this conditional question enhancement to functionality for Survey123? If Esri want to make Survey123 a serious tool in context of others like SurveyGizmo etc, then this really is a must. I would imagine some large local government organisations (who use ArcGIS and AGOL) , especially those who run community engagement activities and currently use SurveyGizmo or Qualtrics, might consider 'switching' more staff to Survey123 - as it offers so much potential to capture community engagement on planning events and integrate better with ArcGIS and AGOL. Cheers

0 Kudos
ClaireProctor
Occasional Contributor

Hi Timna,

This was added in a recent release, actually! You can enter an expression into the 'required' column' of your survey, allowing a question to be considered required based on the input from a previous question. Check out the docs for examples: Form expressions—Survey123 for ArcGIS | ArcGIS 

NickDierks1
Occasional Contributor II

This seems to work as stated in Connect, but not when published as a web form. The question stays required, regardless of any other conditions in the survey.

0 Kudos
ClaireProctor
Occasional Contributor

Yes, this functionality doesn't currently exist in the web form, only in the field app.

ZacharyOrdo__GISP
New Contributor III

Claire Proctor‌ or Nick Dierks could you please provide an example of an if statement you used to get this to work?

0 Kudos
ZacharyOrdo__GISP
New Contributor III

Actually, I finally got it to work.  The expressions are fully case sensitive.  All field names must be entirely lowercase, and the if statement must use the choice name, not the label.  Here's an example of what kind of if statement you would put in the required field on the survey tab:

if( ${doyoulikegis}='no','yes','')

In the above example, if you answer that you don't like GIS, you'd be required to answer the question to which that form expression applies (such as "Why don't you like GIS?")