Select to view content in your preferred language

Survey123 Web: body::esri:visible vs required

3661
14
Jump to solution
09-06-2022 01:53 PM
SMDSAdministrador
Occasional Contributor

Hello everybody.

First, sorry for the bad English (Google Translate).

I have a problem with required questions controlled by the body::esri:visible column on the web. What happens is that, when the condition is not satisfied, the obligation remains. This prevents the form from being submitted (because the required question was not answered) at the same time the question is not displayed (because the condition was not satisfied).

The test form illustrates this situation: if I say that I don't want to display the 'next question' (required and controlled by visible column), Survey123 gives an error when submitting. However, if I withdraw the requirement, the form is successfully submitted.


 

In all the posts and walkthroughs I've read, my understanding is that visible controls a question's visibility and calculations (and I agree with that). However, it doesn't make any sense for the question to remain mandatory even without being displayed, because this practically makes the use of this function unfeasible.

I would like to know if this is expected behavior from Survey123 Web or if there is anything that can be done to work around this situation.

Thank you all

0 Kudos
2 Solutions

Accepted Solutions
Katie_Clark
MVP Regular Contributor

First off, Google translate did an awesome job! English was flawless 😉 

I know in using Survey123 Connect you can conditionally set a question as required if certain criteria is met. See this post for some more info. Hope that helps!

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek

View solution in original post

Ruth_JiatengXu
Esri Contributor

Hi @SMDSAdministrador 

Thanks for raising the issue, and the issue you mentioned has been fixed on current prod environment. The required constraint will be ignored if the question is hidden using body::esri:visible.

Please test with the url parameter ?version=latest if version lock is used.

Thanks,

Ruth

View solution in original post

14 Replies
Katie_Clark
MVP Regular Contributor

First off, Google translate did an awesome job! English was flawless 😉 

I know in using Survey123 Connect you can conditionally set a question as required if certain criteria is met. See this post for some more info. Hope that helps!

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
SMDSAdministrador
Occasional Contributor

Google always saving us! 😂

I often use conditional binding on forms filled out in the field app, but I didn't know it worked on forms filled out on the web as well.

Thank you so much for this! I believe it will solve this problem.

0 Kudos
IsmaelChivite
Esri Notable Contributor

Alternatively, you can also move your body::esri:visible expression to the relevant column and leave your question as required. If a question is not relevant, it will not be shown, its contents will be cleared, and the required and constraint expressions will be ignored.

DougBrowning
MVP Esteemed Contributor

This was fixed when published from connect in the past.  Maybe it has not been fixed in the web yet?

IsmaelChivite
Esri Notable Contributor

@DougBrowning  You are correct. This 'should' work in the web app. I logged an issue so this can be addressed in the future. In the meantime, the relevant workaround may do for @SMDSAdministrador 

SMDSAdministrador
Occasional Contributor

Yes, Ismael. I agree that, in general, the relevant solves most problems (as in the simplified test form I attached above). After all, if I don't need to calculate a value for the question, why use the visible column?! I completely agree.

However, some of our forms are a little more complex and a hidden question can be calculated automatically or not, in the same form (depending on previous conditions). Thus, only the relevant does not meet the needs. But good to know that for the future this will be fixed on the web as well.

For now, @Katie_Clark  solution to using conditionality in the required column resolves the issue well.

Thank you all!

Ruth_JiatengXu
Esri Contributor

Hi @SMDSAdministrador 

Thanks for raising the issue, and the issue you mentioned has been fixed on current prod environment. The required constraint will be ignored if the question is hidden using body::esri:visible.

Please test with the url parameter ?version=latest if version lock is used.

Thanks,

Ruth

SMDSAdministrador
Occasional Contributor

Ruth, we've run some tests and the problem seems to have been resolved. The requirement is being ignored.

Thank you for that.

0 Kudos
DougBrowning
MVP Esteemed Contributor

@SMDSAdministrador   This seems to have come back in the 3.17 update that just came out.  Can you test it again?

Here is mine breaking

visibleandrelevantbroke.gif