0% found this document useful (0 votes)
11 views39 pages

NMC Project 14

The document outlines the structure and components of an XLSForm used for creating surveys in the ODK ecosystem. It includes details on various field types, their descriptions, and how to configure them, as well as instructions for form creation and metadata management. Additionally, it provides resources and tips for effective form design and usage.

Uploaded by

emmanuel prah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views39 pages

NMC Project 14

The document outlines the structure and components of an XLSForm used for creating surveys in the ODK ecosystem. It includes details on various field types, their descriptions, and how to configure them, as well as instructions for form creation and metadata management. Additionally, it provides resources and tips for effective form design and usage.

Uploaded by

emmanuel prah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

type [1] name [2] label [3] hint [4] required [5] relevant [6] appearance [7] default

red [5] relevant [6] appearance [7] default [8] constraint [9] constraint_message [10] calculation [11] trigger [12] choice_filter [13] parameters [14] repeat_count [15] note [16] image [17] audio [18] video [19]
begin_group group_background_info
select_one program program Program yes minimal
${program}
select_one class_rgn class_rgn Class yes
='rgn' minimal

select_one class_rmf class_rmf Class yes ${program}='rmf' minimal


select_one class_nac class_nac Class yes ${program}='nac' minimal
text candidate_number Candidate's Number: yes
select_one ward ward Ward Name yes minimal
date date Date yes
TASK: EDUCATING
PATIENT ON
note survey_title
CONDITION

end_group
Explains the need
integer q1 for education to yes . >= 0 and . <=4 Enter a number between 0-4
patient
Makes patient
comfortable either
integer q2 yes . >= 0 and . <=4 Enter a number between 0-4
sitting or lying
down
Sits comfortably on
integer q3 a chair by yes . >= 0 and . <=4 Enter a number between 0-4
patient's side
Ensures enabling
and relaxed
environment to
integer q4
maintain privacy
yes . >= 0 and . <=4 Enter a number between 0-4
and individuality
of patient
Finds patient's
integer q5 level or awareness yes . >= 0 and . <=4 Enter a number between 0-4
of condition
Builds on what the
patient knows with
scientific data of
integer q6
condition in
yes . >= 0 and . <=4 Enter a number between 0-4
language that
patient understands
Explains to patient
the rationale for
integer q7 yes . >= 0 and . <=4 Enter a number between 0-4
treatment and
possible outcome
Ensures patient
understands the
integer q8 teaching and co- yes . >= 0 and . <=4 Enter a number between 0-4
operates with
health team
Allows patient to
integer q9 ask questions for yes . >= 0 and . <=4 Enter a number between 0-4
clarification
Provides patient
with clear simple
integer q10 yes . >= 0 and . <=4 Enter a number between 0-4
pamphlets if
available
Thanks patient and
integer q11
documents education
yes . >= 0 and . <=4 Enter a number between 0-4

${q1}+${q2}+${q3}
+${q4}+${q5}+${q6}
calculate score_obtained
+${q7}+${q8}+${q9}
+${q10}+${q11}
concat
calculate score_fraction (${score_obtained},'
/44')
score
note obtained:${score_fr max-pixels=1024
action}
text examiner_name Name of Examiner yes
type [1] name [2] label [3] hint [4] required [5] relevant [6] appearance [7] default [8] constraint [9] constraint_message [10] calculation [11] trigger [12] choice_filter [13] parameters [14] repeat_count [15] note [16] image [17] audio [18] video [19]
type [1] name [2] label [3] hint [4] required [5] relevant [6] appearance [7] default [8] constraint [9] constraint_message [10] calculation [11] trigger [12] choice_filter [13] parameters [14] repeat_count [15] note [16] image [17] audio [18] video [19]
type [1] name [2] label [3] hint [4] required [5] relevant [6] appearance [7] default [8] constraint [9] constraint_message [10] calculation [11] trigger [12] choice_filter [13] parameters [14] repeat_count [15] note [16] image [17] audio [18] video [19]
type [1] name [2] label [3] hint [4] required [5] relevant [6] appearance [7] default [8] constraint [9] constraint_message [10] calculation [11] trigger [12] choice_filter [13] parameters [14] repeat_count [15] note [16] image [17] audio [18] video [19]
type [1] name [2] label [3] hint [4] required [5] relevant [6] appearance [7] default [8] constraint [9] constraint_message [10] calculation [11] trigger [12] choice_filter [13] parameters [14] repeat_count [15] note [16] image [17] audio [18] video [19]
list_name [20] name [21] label [22] [23]
ward male_ward Males Ward
ward female_wardA Females Ward A
ward female_wardB Females Ward B
ward children_ward Children's Ward
ward maternity_ward Maternity Ward
ward labour_ward Labour Ward
ward emergency_ward Emergency Ward
ward anc_ward ANC Unit
program rgn Registered General Nursing
program rmf Registered Midwifery
program nac Nurse Assistant Clinical
class_rgn rgn12a RGN12A
class_rgn rgn12b RGN12B
class_rgn rgn13a RGN13A
class_rgn rgn13b RGN13B
class_rgn rgn14a RGN14A
class_rgn rgn14b RGN14B
class_rmf rm9 RM9
class_rmf rm10a RM10A
class_rmf rm10b RM10B
class_rmf rm11 RM11
class_nac nac16 NAC16
class_nac nac17 NAC17

yn yes Yes
yn no No
list_name [20] name [21] label [22] [23]
list_name [20] name [21] label [22] [23]
list_name [20] name [21] label [22] [23]
list_name [20] name [21] label [22] [23]
list_name [20] name [21] label [22] [23]
form_title [24] form_id [25] version [26] instance_name [27] default_language [28]
style [29]
NMC SURVEY-EDUCATING PATIENT ON CONDITION EDUCATING PATIENT ON CONDITION
2022060912
list_name [30] label [31]
Last update License
Getting started with XLSForms
11/2/2023 CC BY-SA

- The XLSForm standard lets you create powerful forms for the ODK ecosystem.
- A form is defined using 4 sheets:
- The survey sheet defines the questions and logic for your form. It is required.
- The choices sheet defines choices to use in select questions.
- The settings sheet defines form metadata and configuration.
- The entities sheet is used to create entities from form values for use in longitudinal workflows, case management, and more.

- The template sheets contain the most common columns. See the Translations and Additional columns sheets for other columns.
- Hover over column names to see a note about how they can be used.
- Columns colored in green on the survey and choices sheets can be translated.

💡 Use File > Make a copy to make a copy of this template that you can edit
💡 Using a consistent column order makes it easier to copy and paste between different form definitions.
💡 Consider hiding columns you don't need instead of deleting them.

Resources
📖 ODK form design docs
🧵 XLSForm tutorial
💬 Forum for support
💡 Have ideas for improving this template? Share them here!

Credits
Styling ideas from yxf script
Inspiration from CartONG's XLSform cheat sheet

Changelog
11/2/2023 Add decimal and text numbers for thousands-sep appearance; add filters on types, appearances and additional columns sheets (thanks @wroos!)
10/24/2023 Add Make a copy tip to readme
10/16/2023 v2023.1 release
Types

The survey sheet's 'type' column determines how the user will be prompted or what will be computed by the form 📋 Form with all question types
💡 See the Appearances sheet to learn how to modify how a question is displayed to users
💡 The parameters column is sometimes used to configure aspects of a question type that are not appearance-related

Field type Description Collect mobile forms Enketo web forms Parameters
text Prompt the user for a text response Yes Yes
integer Prompt the user for an integer response Yes Yes
decimal Prompt the user for a decimal response Yes Yes
note Show the user some text Yes Yes
Record the result of an expression specified in the calculation
calculate Yes Yes
column
select_one list_name Prompt the user to select one choice out of a list Yes Yes randomize, seed
select_multiple list_name Prompt the user to select multiple choices out of a list Yes Yes randomize, seed
Prompt the user to select one choice out of a list of choices from
select_one_from_file file.extension Yes Yes randomize, seed, value, label
a file
Prompt the user to select multiple choices out of a list of choices
select_multiple_from_file file.extension Yes Yes randomize, seed, value, label
from a file
begin_repeat Indicate the start of a group of questions that are repeated Yes Yes
end_repeat Indicate the end of a group of questions that are repeated Yes Yes
begin_group Indicate the start of a group of questions Yes Yes
end_group Indicate the end of a group of questions Yes Yes
capture-accuracy, warning-accuracy,
geopoint Prompt the user to record a single point (a location) Yes Yes
allow-mock-accuracy
geotrace Prompt the user to record a line of points Yes Yes
Prompt the user to record a polygon of points (first and last point
geoshape Yes Yes
are identical)
Record the highest-accuracy point within 20 seconds of creating
start-geopoint Yes Yes
the blank filled form
Prompt the user to select a value in an integer or decimal range
range Yes Yes start, end, step
defined in the parameters column
image Prompt the user for an image Yes Yes max-pixels
barcode Prompt the user to scan a barcode Yes No
quality (normal, low, voice-only,
audio Prompt the user to record or select audio Yes Yes
external; defaults to normal)
background-audio Record audio in the background while filling out the form Yes No quality (normal, low, voice-only)
video Prompt the user to record or select a video Yes Yes
file Prompt the user to attach a file Yes Yes
date Prompt the user for a date response Yes Yes
time Prompt the user for a time response Yes Yes
datetime Prompt the user for a date and time response Yes Yes
rank Prompt the user to rank a list of choices Yes Yes
Attach a CSV to the form for querying. Specify its name without
csv-external Yes Yes
extension in the name column
acknowledge Prompt the user to acknowledge a statement Yes Yes
start Record the time when the blank filled form is created Yes Yes
end Record the time the last time that the filled form is finalized Yes Yes
today Record the date when the blank filled form is created Yes Yes
deviceid Record the install's unique ID (reset on uninstall or cache clear) Yes Yes
username Record the username Yes Yes
phonenumber Record the phone number stored in app settings Yes No
email Record the email stored in app settings Yes No
location-priority, location-min-interval,
audit Log user's actions while filling out the form as an attached CSV Yes No location-max-age, track-changes,
track-changes-reasons, identify-user
Types

The survey sheet's 'type' column determines how the user will be prompted or what will be computed by the form 📋 Form with all question types
💡 See the Appearances sheet to learn how to modify how a question is displayed to users
💡 The parameters column is sometimes used to configure aspects of a question type that are not appearance-related

Field type Description Collect mobile forms Enketo web forms Parameters
Types

The survey sheet's 'type' column determines how the user will be prompted or what will be computed by the form 📋 Form with all question types
💡 See the Appearances sheet to learn how to modify how a question is displayed to users
💡 The parameters column is sometimes used to configure aspects of a question type that are not appearance-related

Field type Description Collect mobile forms Enketo web forms Parameters
Types

The survey sheet's 'type' column determines how the user will be prompted or what will be computed by the form 📋 Form with all question types
💡 See the Appearances sheet to learn how to modify how a question is displayed to users
💡 The parameters column is sometimes used to configure aspects of a question type that are not appearance-related

Field type Description Collect mobile forms Enketo web forms Parameters
Types

The survey sheet's 'type' column determines how the user will be prompted or what will be computed by the form 📋 Form with all question types
💡 See the Appearances sheet to learn how to modify how a question is displayed to users
💡 The parameters column is sometimes used to configure aspects of a question type that are not appearance-related

Field type Description Collect mobile forms Enketo web forms Parameters
Types

The survey sheet's 'type' column determines how the user will be prompted or what will be computed by the form 📋 Form with all question types
💡 See the Appearances sheet to learn how to modify how a question is displayed to users
💡 The parameters column is sometimes used to configure aspects of a question type that are not appearance-related

Field type Description Collect mobile forms Enketo web forms Parameters
Appearances

Appearances configure how a question will be displayed to the user on their device
💡 Most appearances for the same question type can be combined by using a space-separated list

Appearance name Description Type(s) used with Collect mobile forms Enketo web forms
numbers Restrict input to numeric symbols but save the value as text text Yes depends on browser
No (text boxes grow
multiline Show a text area that is multiple lines tall text Yes
vertically as needed)
url Show a button to launch the website represented by this field's value text Yes Yes
Add the Android app ID of a custom application after the ex: prefix to launch text integer decimal image audio
ex: Yes No
that application video file
Automatically add locale-dependent thousands separators on screen but
thousands-sep integer, decimal, text numbers Yes Yes
not in submissions
bearing Prompt the user to capture the device-reported compass direction decimal Yes No
vertical Show a vertical range slider instead of the default horizontal slider range Yes Yes
no-ticks Hide tick marks for a range slider (can combine with vertical) range Yes Yes
picker Show values in a range as a list of options that can be picked range Yes Yes
rating Show values in a range as star ratings range Yes Yes
new Only show the option to capture new media, not to select existing image audio video Yes depends on browser
new-front Only show the option to capture a new picture from front (selfie) camera image Yes depends on browser
draw Prompt the user to draw an image image Yes Yes
annotate Prompt the user to annotate (draw on) an image image Yes Yes
signature Prompt the user to sign their signature image Yes Yes
no-calendar Show date picker as spinners rather than a calendar date datetime Yes Yes
month-year Show date picker for month and year only date Yes depends on browser
year Show date picker for year only date Yes some desktop browsers
ethiopian Show date picker using the Ethiopian calendar date Yes No
coptic Show date picker using the Coptic calendar date Yes No
islamic Show date picker using the Islamic calendar date Yes No
bikram-sambat Show date picker using the Bikram Sambat (Nepali) calendar date Yes No
myanmar Show date picker using the Myanmar calendar date Yes No
persian Show date picker using the Persian calendar date Yes No
placement-map Show a map that the user can manually place and adjust a location on geopoint Yes Yes
Show a map that the user can capture device location on (but not manually
maps geopoint Yes Yes
adjust)
hide-input Show a larger map and hide geo input fields by default geopoint geotrace geoshape N/A Yes
minimal Show a text prompt that when tapped shows all choices all selects Yes Yes
search Allow the user to search the list of available choices all selects Yes Yes
quick Advance to the next screen immediately after a choice is selected select_one select_one_from_file Yes No
columns-pack Show available choices with as may as possible on one line all selects Yes Yes
columns Show available choices in 2, 3, 4 or 5 columns depending on screen size all selects Yes Yes
columns-n Show available choices in the specified number (n) of columns all selects Yes Yes
no-buttons Show available choices without radio buttons / check boxes all selects Yes Yes
Show available choices mapped to the svg file specified in the image
image-map all selects Yes Yes
column
likert Show available choices horizontally as a likert scale select_one select_one_from_file Yes Yes
map Show available choices on a map using each choice's geometry column select_one select_one_from_file Yes No
Yes (only applies in
field-list Show all questions in the field list on the same screen begin_group begin_repeat Yes
pages mode)
label Show only option labels to define the top row of a select grid all selects Yes Yes
list-nolabel Show only radio buttons or checkboxes to define the inside of a select grid all selects Yes Yes
list Show horizontal radio buttons or checkboxes with their labels all selects Yes Yes
Appearances

Appearances configure how a question will be displayed to the user on their device
💡 Most appearances for the same question type can be combined by using a space-separated list

Appearance name Description Type(s) used with Collect mobile forms Enketo web forms
Relevance

Relevance determines whether a question will be displayed to a user or not. It lets you define branching or skip logic in your forms.
💡 Apply relevance to groups or repeats to skip or show multiple questions at once
💡 You can use relevance on a note to provide additional guidance or to confirm a value that could possibly be out of range
💡 You can meet almost any requirement with available functions

Example relevance expression Description


${q1} != '' This question will appear if q1 was not blank
${age} < 18 This question will only appear if previously-entered age was less than 18
If ${random_value} is a calculate with calculation once(random()), this question will be shown half the times
${random_value} < 0.5
that this form is launched
(${computed_months} >= 6 and ${computed_months} < 24) or
Conditions can be combined using and, or
(${months} >= 6 and ${months} < 24)
selected(${q1}, 'nurse') This question will only appear if 'nurse' was selected in q1
selected(${q1}, -88) or selected(${q2}, -88) or selected(${q3},
This question will appear if -88 was selected in any of q1, q2 and q3
-88)
${q1} < 12.5 or selected(${q2}, 'y') This question will appear if q1's value was less than 12.5 or if 'y' was selected in q2
not(selected(${q2}, 'b')) This question will appear if 'b' was not selected in q2
string-length(${q1}) > 3 This question will appear if the answer to q1 had more than 3 characters
This question will never appear. This can be useful when creating a form that is intended to be customized for
false() different environments. Questions or sections that are optional can be marked as non-relevant in the
template.
Constraints

Constraints limit the answers allowed in a field.


💡 Constraints are not evaluated if the answer is blank. To require answers, make the question required.
💡 You can meet almost any requirement with available functions

Example constraint expression Description


. <= 10 Answer must be a number less or equal to 10
. > 10.51 and . < 18.39 Answer must be a number between 10.51 and 18.39, excluding those values
string-length(.) > 5 Answer must be longer than 5 characters
. >= today() Answer must be a date today or later
. >= date('2015-08-01') Answer must be a date August 1st 2015 or later
count-selected(.) <= 3 Answer to this multi select question can only include 0, 1, 2 or 3 choices but no more
not(selected(., 'none') and count-selected(.) > 1) Answer to this multi select question may not include both 'none' and other selections
Another way of expressing the same concept as above: if the 'none' choice is selected, the total number of
if(selected(., 'none'), count-selected(.) = 1, true()) choices selected must be 1. Otherwise, any number of selections is allowed. Replace true() with another
expression to specify a requirement when 'none' is not selected
if(selected(., 'none'), count-selected(.) = 1, count-selected(.) = 2) Answer to this multi select question can either be 'none' or exactly two choices not including 'none'
regex(., '^[A-Za-z]{0,6}$') Answer to this text question may have up to 6 letters
regex(.,'^[A-Z]{3}+_+[A-Z]{3}+_+[0-9]{4}+_+[0-9]{3,4}$') Answer must respect a specific structure (for example this one allows the following : CAR_PRC_2015_048)
Answer to this text question must have an email address structure (note: this is not exact but filters out
regex(., '^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[a-zA-Z]{2,4}$')
obviously-wrong inputs)
regex(.,'^\(?[0-9]{3}\)?-?[0-9]{3}-?[0-9]{4}$') Answer to this text question must have a North American phone number structure
The answer 9999 is always accepted to represent 'unknown'. Otherwise, this question's answer depends on
. = 9999 or (selected(${q1}, 'yes') and . <= 0) or (selected(${q1}, 'no') and . > 0) ${q1}'s answer: if ${q1} was 'yes', then this answer must be a negative number. If ${q1} was 'no', this answer
must be a positive number.
Translations

XLSForms can be translated into multiple languages.


💡 The text on navigation buttons and other system elements are translated as part of the application that shows your form, not as part of the form definition.
💡 Form titles can't be translated.
💡 We recommend that you design your form in one language, test it extensively, and then translate it.
💡 You can specify a default language in the settings sheet.
⚠ There is no fallback language. Specify a translation for every column used in the form. Otherwise, a dash (-) will be shown for text that is not translated to the current language.
⚠ If you use the choices sheet, make sure that all of its text and media columns have translations for all languages.

Add new language


Duplicate all columns that have user-facing text or media to add new language.
These are highlighted in the survey and choices sheets:

label
hint
guidance_hint
constraint_message
required_message
image
audio
video

language name and code


For each language that you need, add the language name and the language code after a :: separator.
You must do this for every column with text or media. Find language codes.
The language name is what data collectors will see. We generally recommend using the language name in the language itself.

label::Español (es)
hint::Español (es)

Example with English and Spanish translations

survey
type name label::English (en) label::Español (es) hint::English (en) hint::Español (es) image::English (en) image::Español (es)

choices
list_name name label::English (en) label::Español (es) image::English (en) image::Español (es)
List lookups

You can look up values from lists specified in the choices sheet, entity lists, attached CSVs, attached geoJSON files and attached XML files by using the instance function.
💡 Choice filters, used to filter lists of items for use in selects, are the same as filter expressions
💡 These queries use a subset of the XPath language. ${} expressions get translated to XPath to access fields in the form

instance('list_name')/root/item[filter expression]/desired_property

list_name The name of the list to get value(s) from


filter expression An expression for filtering the items in the list. You can filter the list down to one single item or multiple. Filter expressions can use functions and any other logic.
property The property you want to access for items that match the filter

Common type of lookup


The most common type of query looks a single item up based on one property and gives back another property's value

instance('list_name')/root/item[match_property = ${q1}]/desired_property

list_name The name of the list to get value(s) from


match_property The property used to look up an item
${q1} A value used to look up the item (e.g., a unique id)
desired_property The property whose value is returned

Example query Description


instance('crops')/root/item[name = ${crop}]/average_yield In a list of crops, use a previously-entered crop name to look up that crop's average yield.
In a list of days, use a previously-entered day number to look up whether or not blood pressure
instance('days')/root/item[number = ${day_number}]/blood_pressure_needed
needs to be entered that day.
In a list of data collector, use a previously-entered data collector id to look up how many visits
instance('data_collectors')/root/item[name = ${data_collector_id}]/visits_complete
the data collector completed.
In a list of houses, use a previously-entered household id to look up the geometry (location) of
instance('houses')/root/item[name = ${hhid}]/geometry
that house.
Filter a list of participants to only those who have not answered yet. Count the number of
count(instance('participants')/root/item[answered = 'no']/label)
matches.
Filter a list of patients to only those with birth year greater than 1978, then filter that list to
sum(instance('patients')/root/item[birth_year > 1978][gender = 'female']/child_count) females only, then get the child count for each of them. The full expression computes the sum
of all children of females born after 1978.
Get the first name of the Nth child in a household with id ${hhid} where N is the position of the
instance('children')/root/item[household = ${hhid}][number = position(..)]/first_name
current repeat in the list of all repeat instances.

💡 You can use these expressions with repeats, too. For example, if ${repeat} is a repeat in your form, you can write
${repeat}[filter expression]/desired_field to access a field in a repeat instance or sum(${repeat}[filter expression]/desired_field) to get the sum of all repeat instances that match the filter.

💡 If you are looking values up in an attached CSV, you can also use the pulldata function. In Collect, this may have better performance for lists with many tens of thousands of elements.
pulldata(list_name, desired_property, match_property, ${q1})

The pulldata expression above is equivalent to:


instance('list_name')/root/item[match_property = ${q1}]/desired_property
Additional columns

The default survey, choices, settings and entities sheets include the most common columns. You may find it useful to add some of the columns described below.

survey sheet Collect mobile forms Enketo web forms Translatable


save_to When using Entities, used to specify the Entity property to save the form field's value to Yes Yes N/A
Used to display additional information to data collectors in a way that is less visible than
guidance_hint Yes Yes Yes
hints
required_message A custom message to replace the generic message when a required value is not filled in Yes Yes Yes
Static values only
read_only An expression used to determine whether the question's value can be edited or not Yes N/A
(yes/no)
instance::my_attribute A custom instance attribute which will be included along with its value in submitted data Yes Yes N/A
bind::my_attribute A custom bind attribute. Generally used when an application has a special custom feature Yes Yes N/A
body::my_attribute A custom body attribute. Generally used when an application has a special custom feature Yes Yes N/A

choices sheet
image An image to show with this choice Yes Yes Yes
audio An audio file to show with this choice Yes Yes Yes
video A video file to show with this choice Yes Yes Yes
A special column that represents a choice's point, trace or shape to be displayed on a map
geometry Yes No N/A
with the map appearance

settings sheet
public_key Public key for encrypting form instances when your server is not trusted Yes Yes N/A
submission_url Specify a URL to make submissions to regardless of how the app is configured Yes No N/A
Add with 'yes' value if you want a single list on the choices sheet to have multiple choices
allow_choice_duplicates Yes Yes N/A
with the same name

entities sheet
create_if A condition that a filled form must meet in order for an entity to be created from it Yes Yes N/A
[1] Determines what kinds of values are allowed and how the field is displayed. For certain types, further
customization is possible using the appearance and parameters columns.

https://docs.getodk.org/form-question-types/

[2] Variable name. It may not contain spaces and must start with a letter or underscore. You should use a
short, descriptive name and can use underscores to separate words. For example: date_of_birth.

[3] The user-visible question text for the field. For example: "When was ${first_name} born?" This text can
optionally reference other fields or be styled using subsets of Markdown and HTML.

Can be translated.

[4] A hint that will be shown to the user below the question's label in smaller text.

Can be translated.

[5] Leave blank for questions that aren't required. Write yes for questions that are required. You can also
use an expression to make a question conditionally required.

https://docs.getodk.org/form-logic/#requiring-responses

[6] An expression that determines whether a question will be displayed to a user or not. Lets you define
branching or skip logic.

See the Relevance tab for examples.

[7] One or more modifiers that determine how the question will be displayed.

See the Appearances tab for details.

[8] A fixed value or an expression that will be evaluated once on form load. The value can then be modified
by the user.

https://docs.getodk.org/form-logic/#setting-default-responses

[9] An expression that determines whether a user-provided answer will be allowed or not. Constraint
expressions use . to mean the value of the current field.

See the Constraints tab for examples.

[10] A message shown when the constraint expression evaluates to false.

Can be translated.

[11] An expression that will be evaluated to determine the value of the field.

⚠ Expressions may be re-evaluated at any time. Question types with calculations should be marked as
read-only. Otherwise, a user-provided value may be replaced by a calculated one.

To limit when expressions are evaluated, for example to specify dynamic defaults, use the trigger column or
the once() function.

https://docs.getodk.org/form-logic/#when-expressions-are-evaluated

[12] Reference to a question that triggers the specified calculation when its value changes only. Useful for
dynamic defaults.

https://docs.getodk.org/form-logic/#dynamic-defaults-from-form-data
[12] Reference to a question that triggers the specified calculation when its value changes only. Useful for
dynamic defaults.

https://docs.getodk.org/form-logic/#dynamic-defaults-from-form-data

[13] Used with select questions to filter the choices shown to the user. The expression will be evaluated
against each choice. If it evaluates to true, the choice is included.

For example, the expression "country = ${country}" includes choices for which the country column's value
matches the value of the ${country} field in the form.

https://docs.getodk.org/form-logic/#filtering-options-in-select-questions

[14] One or more pairs of keys and values that configure aspects of a question type that are not
appearance-related.

For example, an image question might have: max-pixels=1024

[15] The number of instances of a repeat to create. Can be a fixed value or a


dynamic expression.

https://docs.getodk.org/form-logic/#fixed-repeat-count

[16] Can include a human-friendly note to describe the row. This will be ignored by all ODK tools.

[17] Specify the filename of an image to display in addition to or instead of a text label.

Can be translated.

[18] Specify the filename of an audio file. This will display a button to play the audio next to the question
label.

Can be translated.

[19] Specify the filename of a video file. This will display a button to play the video next to the question
label.

Can be translated.

[20] The name of a list. To group choices in a list, give them all the same list_name.

You can use the list_name with select types and as part of instance statements for looking values in lists.

[21] The value that will be saved when this choice is selected. This is the value you will use in analysis.

Like field names, choice names should be short and descriptive (e.g., y for Yes and n for No).

[22] The user-visible text for the choice. This text can have translations or be styled using subsets of
Markdown and HTML.

[23] You can include any number of additional columns to provide information about each list item. These
are useful to chain multiple selects together or look up data based on a selected item.

https://docs.getodk.org/form-logic/#filtering-options-in-select-questions

https://docs.getodk.org/form-datasets/

Also see the List lookups tab.


are useful to chain multiple selects together or look up data based on a selected item.

https://docs.getodk.org/form-logic/#filtering-options-in-select-questions

https://docs.getodk.org/form-datasets/

Also see the List lookups tab.

[24] The title that will be displayed to anyone who uses this form.

https://docs.getodk.org/xlsform/#the-settings-sheet

[25] The unique ID that identifies this form to tools that use it. It may not contain spaces and must start with
a letter or underscore. You should use a short, descriptive name and can use underscores to separate
words.

For example: bench_inventory_2021

You can change the form_title as much as you would like but if you change the form_id, it will be
considered a different form definition.

[26] The unique version code that identifies the current state of the form. A common convention is to use a
format like yyyymmddrr. For example, 2017021501 is the 1st revision from Feb 15th, 2017.

By default, this template uses a formula to create a date-based version that will update automatically.

[27] An expression that will be used to represent a specific filled form created from this form definition. This
will be used in lists of filled forms and on the server.

For example, concat(${first_name}, "-", ${age})

https://docs.getodk.org/xlsform/#naming-filled-forms

[28] If a form has multiple languages, the language that will be selected by default. For example: English
(en)

[29] For Enketo web forms, specify different ways of displaying questions.

theme-grid: display all questions in a compact grid. Use with w* appearances

pages: show each question or field list on its own page (like in Collect). Can optionally combine with theme-
grid.

no-text-transform: can optionally combine with theme-grid to keep question labels lowercase.

[30] The name of the entity list that Entities will be created in.

https://docs.getodk.org/central-entities/

[31] An expression used to create a label for each new Entity.

You might also like