We are using the Inbox for a daily site inspection survey. Some of the answers are prefilled using data from the SCADA system. I have an overnight process which uploads a small JSON snippet to the REST API to add a survey record with several answers prefilled with the SCADA readings. Each morning the site supervisor retrieves the waiting survey from the inbox and completes the rest of the questions. Lots of the questions are required and have default answers but because they are editing an existing survey the defaults don't get populated. This takes extra time and annoys the person filling out the survey and I want to keep them happy
Is there a way trigger default values for existing records when the current value is null? The survey defines the fields as Required and specifies a default value of 0 (Zero) they are all integer fields. Yet if I look at the field definitions in the feature layer they allow NULLs and have no default value. And I don't seem to be able to set the default field values on the feature layer via AGOL. It would be very cumbersome to modify the nightly process to build a JSON string which includes all the fields which have a default value.
Ideally I would like to be able to either set the defaults on the underlying feature layer, or be able to recalculate defaults for unanswered questions when a survey loads from the Inbox. Any ideas? thanks.