Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/form-datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ If you would like to use other properties as values or labels, you can specify t
Building selects from GeoJSON files
------------------------------------

*New in* `ODK Collect v2022.2.0 <https://github.com/getodk/collect/releases/tag/v2022.2.0>`_, `ODK Central v1.4.0 <https://forum.getodk.org/t/odk-central-v1-4/36886>`_; Polygons and lines in Collect v2023.1.0
*New in* `ODK Collect v2022.2.0 <https://github.com/getodk/collect/releases/tag/v2022.2.0>`_, `ODK Central v1.4.0 <https://forum.getodk.org/t/odk-central-v1-4/36886>`_; Polygons and lines in Collect v2023.1.0; Web Forms support in Central v2025.3

GeoJSON files that follow `the GeoJSON spec <https://datatracker.ietf.org/doc/html/rfc7946>`_ can be used to populate select question choices using ``select_one_from_file``. Selects from GeoJSON may be styled as maps using the :ref:`map appearance <select-from-map>` but can also use any other :ref:`select appearance <select-appearances>`. In order to be used by a form, a GeoJSON file:

Expand Down Expand Up @@ -126,7 +126,7 @@ GeoJSON files referenced in forms can have any number of ``features`` and any nu

All properties are displayed by :ref:`select from map <select-from-map>` questions and can be :ref:`referenced by any part of the form <referencing-values-in-datasets>`, just like the columns in a CSV.

Given the GeoJSON file and the form definition above, if the user selected "HR Giger Museum", the value of ``${museum}`` would be ``"fs87b"``.
Given the GeoJSON file and the form definition above, if the user selected "HR Giger Museum", the value of ``${museum}`` would be ``"fs87b"``.

A feature's geospatial representation can be accessed as ``geometry`` and is provided in :ref:`the ODK format <location-widgets>`. For example, the expression ``instance('museums')/root/item[id=${museum}]/geometry`` evaluates to ``46.5841618 7.0801379 0 0`` which is a point in the ODK format.

Expand Down Expand Up @@ -166,7 +166,7 @@ In the example below, a user is first prompted to select a participant from the

select_one_from_file people, participant, Participant
calculate, assigned_place, , instance("people")/root/item[name=${participant}]/place
csv-external, places, ,
csv-external, places, ,
note, place_note, Assigned place: instance("places")/root/item[name=${assigned_place}]/label

.. csv-table:: places.csv
Expand Down
28 changes: 15 additions & 13 deletions docs/form-question-types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ type
appearance
``counter``

The counter appearance allows users to increase a count by one with each click, making it ideal for tracking occurrences, items,
or any sequential tallies. Negative numbers are not supported, so the count starts at zero and only increments upwards.
The counter appearance allows users to increase a count by one with each click, making it ideal for tracking occurrences, items,
or any sequential tallies. Negative numbers are not supported, so the count starts at zero and only increments upwards.
It works exclusively with integers, and decimal values are not supported.

.. image:: /img/form-question-types/counter.*
Expand Down Expand Up @@ -523,7 +523,7 @@ appearance

.. image:: /img/form-question-types/bikram-sambat-calendar-widget.*
:alt: The Bikram Sambat calendar widget.
:class: device-screen-vertical
:class: device-screen-vertical

.. _buddhist-calendar:

Expand All @@ -537,7 +537,7 @@ appearance

.. image:: /img/form-question-types/buddhist-calendar-widget.*
:alt: The Buddhist calendar widget.
:class: device-screen-vertical
:class: device-screen-vertical

.. _coptic-calendar:

Expand Down Expand Up @@ -1147,13 +1147,15 @@ Select one from map widget

`ODK Collect v2023.1.0 <https://github.com/getodk/collect/releases/tag/v2023.1.0>`_

.. versionadded:: v2025.3 Web Forms in Central

type
``select_one {list_name}``
appearance
``map``

.. warning::
The `map` appearance on selects is not yet available in web forms (Enketo).
The `map` appearance for selects is available in Web Forms (added in Central v2025.3) but not in Enketo. See more about the available features of **select one from map** in Web Forms and best practices :ref:`here <web-forms-select-from-map>`.

The different :ref:`basemap sources <mapping-settings>` currently have different performance. If Collect feels slow when creating the map or when selecting a choice, please describe what you are experiencing `on the forum <https://forum.getodk.org/c/support/6>`_. If you have many choices to include on a map, try a provider other than Google or Mapbox. You can also use a :ref:`choice filter <cascading-selects>` to reduce the number of choices that get mapped.

Expand Down Expand Up @@ -1224,11 +1226,11 @@ There are special properties that can be used to style different choices:

- **stroke**: a valid long or short hex color representing the color of a polygon (e.g. ``#aaccee`` or ``#ace``).
- **stroke-width**: a floating-point number (greater than or equal to 0) representing the width of a polygon (e.g. ``5`` or ``6.5``).
- **fill**: a valid long or short hex color representing the interior color of a polygon (e.g. ``#aaccee`` or ``#ace``). It is displayed with transparency that can't be configured.
- **fill**: a valid long or short hex color representing the interior color of a polygon (e.g. ``#aaccee`` or ``#ace``). It is displayed with transparency that can't be configured.

If your geospatial data comes from an external source, you can :ref:`customize the label and underlying value <customizing-label-and-value>`.

If there is an :doc:`offline layer <collect-offline-maps>` specified, it will be displayed under the mapped choices.
If there is an :doc:`offline layer <collect-offline-maps>` specified, it will be displayed under the mapped choices.

.. _image-map-select:

Expand Down Expand Up @@ -1517,7 +1519,7 @@ This question type shows a dialog with the current accuracy and lets the data co
.. csv-table:: survey
:header: type, name, label, hint, parameters

geopoint,geopoint_widget,Geopoint widget,geopoint type,capture-accuracy=10 warning-accuracy=10 allow-mock-accuracy=true
geopoint,geopoint_widget,Geopoint widget,geopoint type,capture-accuracy=10 warning-accuracy=10 allow-mock-accuracy=true

There are three parameters that can be used to customize a ``geopoint`` question's behavior:

Expand Down Expand Up @@ -1884,7 +1886,7 @@ An image widget that does not include a :guilabel:`Choose Image` button. This re
Image widget with custom camera app
""""""""""""""""""""""""""""""""""""""
.. versionadded:: 2024.1.0

When attempting to capture a photo, ODK Collect by default opens the built-in camera app. However, if you wish to utilize a specific camera application, you can do so by including the ``app`` parameter and providing the package name of the desired camera app.

.. rubric:: XLSForm
Expand All @@ -1904,8 +1906,8 @@ Some camera apps to consider:
- `Open Camera <https://play.google.com/store/apps/details?id=net.sourceforge.opencamera>`_ provides many advanced settings

.. note::
- The app with the provided package name must be installed on the device. If it's not available, there will be a toast shown, and it will not be possible to take a picture.
- By default, it's possible to select a picture from the device. Use the ``new`` appearance to prevent this.
- The app with the provided package name must be installed on the device. If it's not available, there will be a toast shown, and it will not be possible to take a picture.
- By default, it's possible to select a picture from the device. Use the ``new`` appearance to prevent this.
- Collect will request a picture, but some camera apps may still allow users to take video. That will fail silently.

.. _self-portrait-image-widget:
Expand Down Expand Up @@ -2019,7 +2021,7 @@ Images created with any of the image widgets described above can be automaticall

- a jpg image is attached not captured
- and the attached file has quality lower than 80%
- and the difference between its original size and the value specified using ``max-pixels`` is not big enough
- and the difference between its original size and the value specified using ``max-pixels`` is not big enough

the size of the output image might be even bigger that the original one.

Expand Down Expand Up @@ -2708,7 +2710,7 @@ We recommend writing your HTML with fixed sample values first, trying it in a we
This question type understands a custom ``qrcode`` element. Any text values placed within opening and closing ``qrcode`` tags will be encoded as a QR code and shown as an image You can apply the same attributes and styling to this element as you would to an ``img`` element.

The calculation used to generate the card in the screenshot above is::

concat("
<qrcode width='150' height='150'>", ${first_name}, " ", ${last_name}, " ", ${age}, " ", ${email}, " ", ${phone_number}, "</qrcode></br>
<img width='150' src='", ${photo}, "'>
Expand Down
3 changes: 3 additions & 0 deletions docs/img/web-forms/select-one-from-map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 24 additions & 3 deletions docs/web-forms-intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ When a form includes a geopoint question, users of the form will see a :guilabel
:alt: Web Forms location permissions request

.. warning::

Different browsers manage location permissions differently. Some may not prompt for the permission and may require users to go to their settings to grant location access.

If a user denies location permissions to a form, that permission will apply for all forms on that server and a user may need to go to browser settings to grant the permission.
Expand Down Expand Up @@ -102,11 +102,32 @@ By default, choices with images are displayed in a grid. Each choice container i
If you would like to display one choice with image per row, as is the default for Collect, you can use the :ref:`columns-1 appearance <select-columns-n-widget>`.

Form styling
~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~

.. seealso:: :ref:`Markdown in forms<markdown-in-forms>`
.. seealso:: :ref:`Markdown in forms <markdown-in-forms>`

You can style text such as notes, labels, hints, options, and validation messages using Markdown format.

.. image:: /img/web-forms/form-styling.*
:alt: Styling in Web Forms

.. _web-forms-select-from-map:

Select one from map
~~~~~~~~~~~~~~~~~~~

.. versionadded:: Central v2025.3

The :ref:`select one from map question type <select-from-map>` allows users to select an option from choices displayed on a map. Each choice must include a ``geometry`` column in the ``choices`` sheet. The map uses OpenStreetMap as the base layer and supports zooming, panning, and tapping features to view details and make a selection.

.. image:: /img/web-forms/select-one-from-map.*
:alt: Select one from map in Web Forms

When defining properties, keep the list concise and easy to read, as it appears in a compact popup on selection.

The following features are not supported yet:

- The ``quick`` appearance
- Offline tiles
- Map layer customization (e.g., switching to Google Maps or Mapbox, terrain or satellite views)
- Custom styling for points (``marker-color`` and ``marker-symbol``), lines (``stroke`` and ``stroke-width``) and shapes (``stroke``, ``stroke-width``, and ``fill``)