Select to view content in your preferred language

Default answer in edit mode

318
2
11-12-2024 06:29 PM
RHammers
Occasional Contributor

Hello! Is it possible to have a survey apply a default answer every time the survey is opened in edit mode, regardless of whether or not the question in particular already has an answer? For example, I'd like to have the response always default to "No" when opened in edit mode, even if it was previously set to "Yes".

0 Kudos
2 Replies
ChristopherCounsell
MVP Regular Contributor

Defaults apply to new records, They would work for new surveys, or new repeat entries within an edit mode.

Calculation modes don't really allow for this. There might be some levels, like calculating if empty, but nto changing the answer.

https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-calculation-modes/...

You might be able to achieve it through the use of null questions which won't store a value. e.g.

  1. Set up a question e.g. 'temp_field' that calculates to 'New' with a null field binding
  2. Set up question relevancy selected($'{temp_field}', 'New') on the questions you want to default to 'No'
  3. Add calculations on the questions you want to default to 'No' (not default).

I believe that data will submit OK, but then when users go to edit the relevancy might clear the data as the 'null' question hasn't retained its answer from the previous submission, then the calculations would re-trigger. However it's not something I've done and am not 100% sure it will work.

You could also explore using repeats to add data where the defaults would apply, and then calculating the hidden parent questions with the latest responses. Much better data entry and history retention.

0 Kudos
DougBrowning
MVP Esteemed Contributor

You can check if you are in edit mode with pulldata("@property", 'mode')

But you could only calcs something like if(edit mode, "Yes", "then here it has to be No or blank")  You can never in 123 say calc this or leave it alone.  But this Yes or No may work for you.

See more info here  https://community.esri.com/t5/arcgis-survey123-questions/editing-from-inbox-can-i-make-some-fields-r... 

0 Kudos