Default values for Inbox surveys

10-01-2020 11:36 PM
New Contributor

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.

3 Replies
MVP Esteemed Contributor

Default values also do not work when a field appears from a relevant.  Not sure if this is related.  That one had been a bug for a number of years now.  (well 2.5 years )  

I have been using calc to get around it.  It is a little weird because a recal button will appear if they change the value.  But is does work.  In other words add your default to the calculation column.  Note at times I have seen this be an issue when coming back from drafts but still trying to figure that one out.

Hope that helps. I hope they fix this one at some point.

New Contributor

Thanks Doug Browning that helps.‌  Most of the questions where always shown, I put a relevant on all the groups which contain defaults, once the first question is answered they all become relevant and the defaults get calculated.  Looking at all your posts and those of others it seems like I had better keep an eye on things to make sure it keeps working - I guess the guy filling out the survey will let me know pretty quick if it doesn't.

0 Kudos
New Contributor III

For calculations

Calculation modes 

0 Kudos