NMC Project 14
NMC Project 14
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
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
label
hint
guidance_hint
constraint_message
required_message
image
audio
video
label::Español (es)
hint::Español (es)
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
instance('list_name')/root/item[match_property = ${q1}]/desired_property
💡 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 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.
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.
[7] One or more modifiers that determine how the question will be displayed.
[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.
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.
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/
https://docs.getodk.org/form-logic/#filtering-options-in-select-questions
https://docs.getodk.org/form-datasets/
[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.
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.
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.
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/