Setting a Default Value on a field with a Relevant?

942
6
05-23-2018 09:52 AM
Highlighted
Frequent Contributor II

I have a select_one field that I want to set a Default value for but it will not work.

I think I know why.  The field has a Relevant on it.  That means it does not show on form load.  Since Default Values are set at form start - and the field is not there - it does not get the default value.

Is this correct?  Any way around this?

Thanks

Reply
0 Kudos
6 Replies
Highlighted
Esri Frequent Contributor

Hi Doug,

Yes, you are correct. Default values currently only get populated or calculated on the initial form load, so questions that are not relevant at that time will not be populated. Alternatively you could try and use the calculation field instead to set your default, as this should be populated when it becomes relevant, or when a question preceding is changed, causes the calculation to be re-run.

We are currently working on improving the default value behaviour to also update when a question becomes relevant, as well as other improvements to calculation behaviour with relevant and repeats.

Phil.

Reply
0 Kudos
Highlighted
New Contributor III

Philip were you all every able to resolve this?  The documentation on defaults says "or when it becomes relevant".  Much like the previous poster this is not the case.  You can actually see it flash with the defaults and then clear them back out.I just installed the latest Survey123 Connect yesterday so i'm sure its the latest. 

Reply
0 Kudos
Highlighted
Frequent Contributor II

I have been using a calculation for now to get around it.  But it has been a year on this one...

Reply
0 Kudos
Highlighted
New Contributor III

How do you use the calculation for this? Seems like it would keep overwriting your answers.

Reply
0 Kudos
Highlighted
Frequent Contributor II

No the new version will only update if you hit the green refresh.  You can also stick a once() around it.

And I meant use the Calculation column not the type.  So say text type and then calculation.

Reply
0 Kudos
Highlighted
New Contributor III

Perfect, thanks for the help.

Reply
0 Kudos