Webforms behaviour notes

1. What is the issue? Please be detailed.
Collecting webforms issues/glitches - sorry if these are already solved but not released, I'm on v0.24.0

  • if a label's line ends with a ${} field and there is then a newline entered in the form definition, the newline is ignored and the following line will run on. If the line ends in a character and then the newline, the newline is used. eg ending as text ${field} vs text ${field} text

  • when geopoint/trace/shape values are manually placed the value returned is only lat long whereas in Collect / Enketo they are lat long altitude precision and Collect uses '0.0' vs Enketo uses 0

    • discovered as I used a constraint on the geopoint to force manual placement as selected-at(., 3) = 0 and I couldn't proceed in WF. Modifying it to selected-at(., 3) = 0 or selected-at(., 3) = '' fixed my issue.
    • link to github issue #811
  • using now() in the default column doesn't load the current date to the question, is blank. Works ok in Collect.

    • This is a collect issue, any connection?
    • To test, a field with a now() calculation shows in an note as 2026-05-19 in Collect but in WF it's shown as 2026-05-19T16:17:32.366+10:00, the submitted field value in Collect / Enketo CSV is 2026-05-19T16:17:32.366+10:00 though.
  • dynamic image defaults where the image field has a triggered calculation like concat('jr://images/',${selected_drawing_to_load}) do not work, the image is not loaded.

    • dynamic defaults are marked as complete but this case doesn't seem to work. Other text/select dynamic defaults are ok.
  • For questions that have image / big-image, the big-image file path&name is appended to the label eg "My reference drawingjr://images/my_reference_dwg.pdf"

  • A dynamic default for a geopoint doesn't show a pin on the map when calculated in but does show ":white_check_mark: Point Saved" at the bottom. Unlike Collect there is no co-ord value shown so it doesn't actually appear to the user as if the default was loaded, but the submission correectly contains the point.

May I add one ?
Using the distance(geotrace) function to calculate the length of a geotrace returns an error where enketo do not :-1:

The function 'distance' received a value that does not represent GPS coordinates

@ahblake
Hey, so far I was able to reproduce two of your issues: First one with label's line ending with a${} and the last one with a dynamic default for a geopoint.

I've already filled separate issues and we'll be tracking that.

I was not able to reproduce this one:

using now() in the default column doesn't load the current date to the question, is blank. Works ok in Collect.

I've used the now() in the default column and it is not blank in Web Forms. Could you maybe share your form?

webforms_now_date.xlsx (225.5 KB)

Here is an example. enter_date does not get the default value in v0.24.0. There is no relevance / required etc on this, moving it outside a group made no change. Does work in Enketo.

Also tried putting a field in the default where that field was a calculate with now(), doesn't work in enketo or WF.

I can reproduce this issue. The problem is to do with the type of the field - if I change enter_date to dateTime then it works. Essentially you're trying to stuff a dateTime into a date and it doesn't work.

I'll investigate what the correct behaviour is, but for now switching to dateTime is a workaround.

Issue raised: https://github.com/getodk/web-forms/issues/830

So WF is more correct (wrong type, fail) and Collect/Enketo are more forgiving (use the date portion).

As I want it to be a date value I would have to change the default expression to format-date(now(), '%Y-%m-%d') (tested, works in Enketo/WF)

This is somehow related perhaps: the now() value from a calc field renders as a date only in a note in Collect, but the submitted field value is a datetime, and this value renders in a note as a datetime in WF. So Collect is treating it two different ways?

Other options:

  • use today(), instead of now()
  • or ${today}, metadata
  • convert the now to a date, try date( decimal-date-time(now()) )
  • for a note: format-date-time(now(), ...)
  • use today(), instead of now()
    • for the specific issue of loading the current date as the default to a date question, this is the simplest solution.
  • or ${today}, metadata
    • works in WF, not in enketo
  • convert the now to a date (i.e. decimal-date-time(now())
    • this breaks the parser java.lang.IllegalArgumentException: Invalid cast of data [20622.0604915625] to type Date
    • the overly complicated date(decimal-date-time(now())) works for enketo but doesn't work for webforms, which is expected as the expression returns a datetime not a date. the docs could benefit from a small edit here to clarify:
      • Converts an integer representing a number of days from January 1, 1970 (the Unix Epoch) to a standard date datetime value.

  • for a note: format-date-time(now(), ...)
    • this also works as a default for a date field.

I know big-image is not complete on the matrix yet, but I can't find a post highlighting this seemingly related behaviour, so chucking it in this thread.

  1. When a choice has an image and a big-image, selects get the path to the big-image media appended to the label.
  2. If the same file is used for image and big-image, the thumbnail is not shown against the select (file is uploaded).

redacted example, labels should only have text to the left of jr://. Difference between displayed image (1st option) when big-image is a different file and not displayed when they are the same file (options 2 & 3)

Is there a list of all accepted image types for WF? (related, how about Collect?) It's not clear in the docs.

HEIC can be used in Collect as a source, and will remain in this format if not annotated (A 'chosen' HEIC image was uploaded to central as HEIC with my max-pixels resolution), but returns Failed to load image. if HEIC is chosen in WF.

WEBP is accepted by WF and unannotated uploads as WEBP (yet untested in Collect)

I'm not campaigning for esoteric formats to be included, but HEIC does seem like it will become more common and is more space/bandwidth efficient.

Hi @ahblake!

Web Forms doesn't have an explicit allowlist for image formats. It accepts any file whose MIME type is image/*. However, the drawing tool for annotate, draw, and signature always outputs JPEG, because the tool uses a white background by default, and JPEG doesn't support transparency (transparent pixels would turn black). JPEG also gives good compression for photo content while keeping good quality.

It seems that HEIC/HEIF is a format on Apple devices. These files pass validation since their MIME type is image/heic or image/heif, but Chrome and Firefox don't have native HEIC decoding on non-Apple platforms, so they could behave unexpectedly in Web Forms. Safari works better in that case since Apple controls the full codec stack. That said, codec support can vary by OS and browser version. We still need to research the codec support further.

Is HEIC/HEIF the preferred format in your organization?

The HEIC image i tried in was actually one i shot on an android phone, used with Choose Image in a Collect submission and uploaded without annotation, then downloaded and tried to use via the file picker in WF (chromium browser in macos).

I don't have a need for HEIC or WEBP (although i am tempted to investigate use for media if it offers better quality/kb than JPG/PNG), i was mostly surprised that HEIC wasnt accepted.