Preview/Enketo: Invalid Default sets field to required / forces entry


Default can only use fixed (literal) values, like 1 or ‘my text’. If you use something else, like a wrong format, a $-Reference or even calculation, the entry field will temporarily be treated as required. (even if explicitly set to false).
Problem is only with Preview/Enketo.
KoBoCollect works ok (Next not blocked)

Steps to Reproduce

See attached file
BugWrongDefault03.xlsx (12.0 KB)

  1. Set an invalid default, like “abc” for date field
  2. Move to field - No default is set, but, but date select widget opens
  3. Next, will only work if you entered a date!

Expected behavior

  1. Wrong default (and system in general) should not require data entry
  2. An error message on import or preview for non-valid defaults would be great.
  3. Support article that default works very restricted (No hint in XLSForm spec:
  4. Add tag for “default”’ (or “default-value”) for community topics

Actual behavior

You are forced to enter a value, for the field by default or explicitly specified as required = false. See above screenshot and attached XLSForm.

Additional details

If you entered a field and moved on (Next) you can come BACK and delete your entry and move on now with Next WITHOUT being blocked as before. So it’s related to the DEFAULT situation!
Preview/Enketo on OCHA Server.

Furthermore, can someone tell, if the restriction for default-values is even on XLSForm level?
Kind regards

Dear @Kal_Lam
thanks for the topic tag.
May I ask you, please, to delete my previous post version. Only keep the last one.
Kind regards
and Happy New Year

1 Like