Setting a Default Value on a field with a Relevant?

1870
6
05-23-2018 09:52 AM
DougBrowning
MVP Esteemed Contributor

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

0 Kudos
6 Replies
by Anonymous User
Not applicable

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.

0 Kudos
BrianWilson3
Occasional Contributor

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. 

0 Kudos
DougBrowning
MVP Esteemed Contributor

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

0 Kudos
BrianWilson3
Occasional Contributor

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

0 Kudos
DougBrowning
MVP Esteemed Contributor

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.

0 Kudos
BrianWilson3
Occasional Contributor

Perfect, thanks for the help.

0 Kudos