Select to view content in your preferred language

Automatic clear/reset responses to questions

658
3
Jump to solution
08-16-2023 12:45 PM
JayHodny
Frequent Contributor

Hello.  I have a refuse cart survey developed using Survey123 Connect and ArcGIS for Enterprise.  I have an initial select_one question with three possible answers - order new carts, order second carts, or order replacement carts.  Each answer, when chosen, opens a set of questions relevant to that choice.  We are wondering if we switch choices mid-stream, e.g., I (accidentally) selected new carts, then realize I should have chosen second carts, can the responses populating the original (new cart) questions be cleared or deleted automatically when I switch my initial choice (second carts)?  We don't want to submit/save data into the service for carts we don't want to distribute, causing confusion.  I hope this makes sense.  Thanks in advance, Jay

0 Kudos
1 Solution

Accepted Solutions
Katie_Clark
MVP Regular Contributor

Hi Jay!

I recommend looking over this blog post, specifically the "Dynamically hiding questions using body::esri:visible and relevant" section. I think relevant is what you want here, if I'm understanding correctly. 

"The relevant column, like body::esri:visible, controls the visibility of a question, but it also clears the value in the question when the expression evaluates to false."

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

3 Replies
Katie_Clark
MVP Regular Contributor

Hi Jay!

I recommend looking over this blog post, specifically the "Dynamically hiding questions using body::esri:visible and relevant" section. I think relevant is what you want here, if I'm understanding correctly. 

"The relevant column, like body::esri:visible, controls the visibility of a question, but it also clears the value in the question when the expression evaluates to false."

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
JayHodny
Frequent Contributor

Hi Katherine,

Excellent, let me look this over, but it sounds like what I am after.

Many thanks, Jay

JayHodny
Frequent Contributor

Hi Katherine,

The relevance option worked!  I had relevance on the questions already, but when we were working in the form - before submitting - the answers persisted regardless of which initial choice we made.  Once submitted, the relevance evaluated to false on the questions that were no longer relevant, clearing the responses and not saving them in the service.  Thank you again for your help.

0 Kudos