Skip to content

Instantly share code, notes, and snippets.

@yanokwa
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yanokwa/88e33de4303b0c5f4f9e to your computer and use it in GitHub Desktop.
Save yanokwa/88e33de4303b0c5f4f9e to your computer and use it in GitHub Desktop.
/help/form-design/xlsform/
This page redirects to http://xlsform.org. If you want to make changes, edit https://github.com/XLSForm/xlsform.github.io instead.
XLSForm is a tool to simplify the creation of forms. Forms can be designed with Excel and XLSForm will convert it to an XForm that can be used with ODK tools. This tutorial teaches you to build your forms using Excel. Please refer to the <a href="http://opendatakit.org/wp-content/uploads/2013/06/sample_xlsform.xls">sample Excel file</a> as you read through the tutorial.
<h1>Basic format</h1>
Each workbook must have two worksheets: survey and choices.
<ul>
<li>The survey worksheet contains the structure and most of the content of the form. It contains the full list of questions and information about how they should be presented. Most rows represent a question; the rest of the rows specify control structures such as groups.</li>
<li>The choices worksheet is used to specify the options for multiple choice questions. Each row represents a multiple choice option. Choices with the same list name are considered part of a related set of choices. This allows a set of choices to be reused in multiple select questions (for example, yes/no choices).</li>
</ul>
Each of these worksheets has a set of necessary columns that must be present for the .xls file to be valid. Additionally, each worksheet has a set of optional columns that allow further control over the behavior of each entry in the form, but are not essential to the specification. Every entry must have values for each necessary column, but any of the optional columns may be left blank from entry to entry. For example, in the survey worksheet, each question must have a name specified, but one question may have a numerical constraint specified while another has an image file and a third may have niether. These columns, necessary or optional, may appear in any order. Optional columns may be left out completely. Any number of rows may be left blank. All .xls file formatting is ignored so that dividing lines, shading, and font formatting can be used to make the specification more readable.
<h1 dir="ltr">Question Types</h1>
ODK Collect supports a number of simple question types:<strong><strong> </strong></strong>
<div dir="ltr">
<table><colgroup> <col width="189" /> <col width="435" /></colgroup>
<tbody>
<tr>
<td>text</td>
<td>Text input.</td>
</tr>
<tr>
<td>integer</td>
<td>Integer (ie, whole number) input.</td>
</tr>
<tr>
<td>decimal</td>
<td>Decimal input.</td>
</tr>
<tr>
<td>select_one [options]</td>
<td>Multiple choice question; only one answer can be selected.</td>
</tr>
<tr>
<td>select_multiple [options]</td>
<td>Multiple choice question; multiple answers can be selected.</td>
</tr>
<tr>
<td>note</td>
<td>Display a note on the screen, takes no input.</td>
</tr>
<tr>
<td>geopoint</td>
<td>Collect GPS coordinates.</td>
</tr>
<tr>
<td>image</td>
<td>Take a photograph.</td>
</tr>
<tr>
<td>barcode</td>
<td>Scan a barcode, requires the barcode scanner app is installed.</td>
</tr>
<tr>
<td>date</td>
<td>Date input.</td>
</tr>
<tr>
<td>datetime</td>
<td>Accepts a date and a time input.</td>
</tr>
<tr>
<td>audio</td>
<td>Take an audio recording.</td>
</tr>
<tr>
<td>video</td>
<td>Take a video recording.</td>
</tr>
<tr>
<td>calculate</td>
<td>Perform a calculation; see “calculates” below.</td>
</tr>
</tbody>
</table>
</div>
To collect the name and gps coordinates of a store use the following Excel file:
<div dir="ltr">
<table><colgroup> <col width="60" /> <col width="70" /> <col width="71" /> <col width="423" /></colgroup>
<tbody>
<tr>
<td>survey</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>type</td>
<td>name</td>
<td>label</td>
</tr>
<tr>
<td></td>
<td>text</td>
<td>name</td>
<td>What is the name of this store?</td>
</tr>
<tr>
<td></td>
<td>geopoint</td>
<td>geopoint</td>
<td>Collec the GPS coordinates of this store.</td>
</tr>
</tbody>
</table>
</div>
&nbsp;
<h1 dir="ltr">Muliple Choice Questions</h1>
ODK Collect has support for both ‘select one’ and ‘select all that apply’ questions. To write a multiple choice question requires adding a second worksheet called ‘choices’ to our Excel workbook. Here is an example of a ‘select one’ question:<strong><strong> </strong></strong>
<div dir="ltr">
<table><colgroup> <col width="66" /> <col width="145" /> <col width="95" /> <col width="318" /></colgroup>
<tbody>
<tr>
<td>survey</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>type</td>
<td>name</td>
<td>label</td>
</tr>
<tr>
<td></td>
<td>select_one yes_no</td>
<td>likes_pizza</td>
<td>Do you like pizza?</td>
</tr>
<tr>
<td>choices</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>list name</td>
<td>name</td>
<td>label</td>
</tr>
<tr>
<td></td>
<td>yes_no</td>
<td>yes</td>
<td>Yes</td>
</tr>
<tr>
<td></td>
<td>yes_no</td>
<td>no</td>
<td>No</td>
</tr>
</tbody>
</table>
</div>
<ol>
<li>There are three columns on the ‘choices’ sheet: ‘list name’ contains the name of multiple choice list this choice belongs to. ‘name’ holds the value that will be submitted to the database if this choice is selected. ‘label’ is what will appear on the phone for this choice.</li>
<li>To add a select one question to your survey you must add a question with type ‘select_one list-name’ where ‘list-name’ must match a list from the ‘choices’ worksheet.</li>
</ol>
We can also add multiple choices questions that allow multiple answers to be selected, like so:
<div dir="ltr">
<table><colgroup> <col width="66" /> <col width="150" /> <col width="90" /> <col width="318" /></colgroup>
<tbody>
<tr>
<td>survey</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>type</td>
<td>name</td>
<td>label</td>
</tr>
<tr>
<td></td>
<td>select_multiple pizza_toppings</td>
<td>favorite_topping</td>
<td>Favorite toppings</td>
</tr>
<tr>
<td>choices</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>list name</td>
<td>name</td>
<td>label</td>
</tr>
<tr>
<td></td>
<td>pizza_toppings</td>
<td>cheese</td>
<td>Cheese</td>
</tr>
<tr>
<td></td>
<td>pizza_toppings</td>
<td>pepperoni</td>
<td>Pepperoni</td>
</tr>
<tr>
<td></td>
<td>pizza_toppings</td>
<td>sausage</td>
<td>Sausage</td>
</tr>
</tbody>
</table>
</div>
Notes / Caveats:
<ul>
<li>Make sure you don’t forget the first row and the headings “list name”, “name” and “label.”</li>
<li>Make sure that your column headers in the “choices” sheet match those in the “survey” sheet (i.e. there will be errors if you columns are “label:English” on the survey and “label” on the choices worksheet)</li>
</ul>
&nbsp;
<h1 dir="ltr">Specify Other</h1>
For multiple choice options, one might want to add an “Other” option, which if picked has to be specified further by the user in a free text input field. This is possible through xlsform by having an option list that includes “Other” as an option, and a second question that is relevant only if “Other” was selected the first time around. But because this has to be done a lot in the early phases of surveying, xlsform has a shortcut to make this easy.
<div dir="ltr">
<table><colgroup></colgroup>
<tbody>
<tr>
<td>survey</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>type</td>
<td>name</td>
<td>label</td>
</tr>
<tr>
<td></td>
<td>select_multiple pizza_toppings or_other</td>
<td>favorite_topping</td>
<td>Favorite toppings</td>
</tr>
<tr>
<td>choices</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>list name</td>
<td>name</td>
<td>label</td>
</tr>
<tr>
<td></td>
<td>pizza_toppings</td>
<td>cheese</td>
<td>Cheese</td>
</tr>
<tr>
<td></td>
<td>pizza_toppings</td>
<td>pepperoni</td>
<td>Pepperoni</td>
</tr>
<tr>
<td></td>
<td>pizza_toppings</td>
<td>sausage</td>
<td>Sausage</td>
</tr>
</tbody>
</table>
</div>
This form with automatically ask the user if her/his favorite toppings are cheese, pepperoni, sausage or other, and if the user selects other, what their favorite topping is. Try it out! Notes / Caveats:
<ul>
<li>If you have data like this, when you export data, in the pizza_toppings column, you will see a value ‘other’. A second column will have the answer for the questions which the user selected ‘other.’ This makes doing data analysis more cumbersome, so we don’t recommend the or_other construct for large-scale data collection efforts. The option is perfectly appropriate for pilots, however.</li>
</ul>
&nbsp;
<h1 dir="ltr">Cascading Selects</h1>
In Collect 1.2 and above it is possible to create cascading selects (select type questions where the options depend on the options selected in previous questions). For example, you could display cities in a select question based on the country selected in a previous question. In order to use cascading selects you will need to create a choice_filter column in your survey sheet and add some attribute columns to filter on in your choices sheet. <a href="http://opendatakit.org/wp-content/uploads/2012/07/new_cascading_select.xls">There is an example XLSForm available here</a>. There are a few caveats to bear in mind: or_other is currently not supported for cascading selects. Best practice for naming attribute column headers in the choices sheet is to begin your names with attr and only use letters (no spaces).
<h1 dir="ltr">Metadata</h1>
ODK Collect makes a number of metadata fields available for collection:<strong><strong> </strong></strong>
<div dir="ltr">
<table><colgroup> <col width="126" /> <col width="469" /></colgroup>
<tbody>
<tr>
<td>start</td>
<td>Start date and time of the survey.</td>
</tr>
<tr>
<td>end</td>
<td>End date and time of the survey.</td>
</tr>
<tr>
<td>today</td>
<td>Day of the survey.</td>
</tr>
<tr>
<td>deviceid</td>
<td>IMEI (International Mobile Equipment Identity)</td>
</tr>
<tr>
<td>subscriberid</td>
<td>IMSI (International Mobile Subscriber Identity)</td>
</tr>
<tr>
<td>sim_serial</td>
<td>SIM serial number.</td>
</tr>
<tr>
<td>phone_number</td>
<td>Phone number (if available).</td>
</tr>
</tbody>
</table>
</div>
If I wanted my survey to collect all of this metadata I would put the following at the top of the survey:
<div dir="ltr">
<table><colgroup> <col width="60" /> <col width="106" /> <col width="122" /> <col width="336" /></colgroup>
<tbody>
<tr>
<td>survey</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>type</td>
<td>name</td>
<td>label</td>
</tr>
<tr>
<td></td>
<td>start</td>
<td>start</td>
<td></td>
</tr>
<tr>
<td></td>
<td>end</td>
<td>end</td>
<td></td>
</tr>
<tr>
<td></td>
<td>today</td>
<td>today</td>
<td></td>
</tr>
<tr>
<td></td>
<td>deviceid</td>
<td>deviceid</td>
<td></td>
</tr>
<tr>
<td></td>
<td>subscriberid</td>
<td>subscriberid</td>
<td></td>
</tr>
<tr>
<td></td>
<td>sim_serial</td>
<td>simserial</td>
<td></td>
</tr>
<tr>
<td></td>
<td>phone_number</td>
<td>phonenumber</td>
<td></td>
</tr>
</tbody>
</table>
</div>
Notice there are no labels associated with the metadata, that’s because the phone captures these variables automatically. These questions will not appear on the screen of the phone, but will be included in the xml file ODK Collect writes to store and transmit the survey data. To see this fields in action, fill out a survey on your phone, connect your phone to your computer and use the sd card as a USB flash drive, navigate to /sdcard/odk/instances and checkout the xml files in the folders there. This will give you an idea of what the data looks like.
<h1 dir="ltr">Hints</h1>
It’s easy to add hints to questions.  Simply type in text under the hint column for a question.<strong><strong> </strong></strong>
<div dir="ltr">
<table><colgroup> <col width="66" /> <col width="73" /> <col width="72" /> <col width="209" /> <col width="204" /></colgroup>
<tbody>
<tr>
<td>survey</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>type</td>
<td>name</td>
<td>label</td>
<td>hint</td>
</tr>
<tr>
<td></td>
<td>text</td>
<td>name</td>
<td>What is the name of this store?</td>
<td>Look on the signboard if the store has a signboard.</td>
</tr>
<tr>
<td></td>
<td>geopoint</td>
<td>geopoint</td>
<td>Collec the GPS coordinates of this store.</td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div dir="ltr"></div>
&nbsp;
<h1 dir="ltr">Grouping Questions</h1>
To create a group of questions try the following:<strong><strong> </strong></strong>
<div dir="ltr">
<table><colgroup> <col width="65" /> <col width="99" /> <col width="97" /> <col width="363" /></colgroup>
<tbody>
<tr>
<td>survey</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>type</td>
<td>name</td>
<td>label</td>
</tr>
<tr>
<td></td>
<td>begin group</td>
<td>respondent</td>
<td>Respondent</td>
</tr>
<tr>
<td></td>
<td>text</td>
<td>name</td>
<td>Enter the respondent’s name</td>
</tr>
<tr>
<td></td>
<td>text</td>
<td>position</td>
<td>Enter the respondent’s position within the school.</td>
</tr>
<tr>
<td></td>
<td>end group</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
This is a good way to group related questions. To create a repeating group of questions use the following construct:
<div dir="ltr">
<table><colgroup> <col width="60" /> <col width="98" /> <col width="71" /> <col width="395" /></colgroup>
<tbody>
<tr>
<td>survey</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>type</td>
<td>name</td>
<td>label</td>
</tr>
<tr>
<td></td>
<td>begin repeat</td>
<td>member</td>
<td>Household Member</td>
</tr>
<tr>
<td></td>
<td>text</td>
<td>name</td>
<td>Name of household member.</td>
</tr>
<tr>
<td></td>
<td>integer</td>
<td>age</td>
<td>Age of household member.</td>
</tr>
<tr>
<td></td>
<td>end repeat</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
This is a list of household members, with the name and age of each household member. The phone will ask the name and age of the first household member, and then ask if the enumerator wants to add another ‘Household Member’ group. If the enumerator responds with a ‘yes’ then the name and age of the second household member will be asked, and so on. All data within repeats will be exported in a different worksheet inside excel files.
<h1 dir="ltr">Nesting Groups of Questions</h1>
Groups of questions can be nested:<strong><strong> </strong></strong>
<div dir="ltr">
<table><colgroup> <col width="61" /> <col width="167" /> <col width="153" /> <col width="243" /></colgroup>
<tbody>
<tr>
<td>survey</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>type</td>
<td>name</td>
<td>label</td>
</tr>
<tr>
<td></td>
<td>begin group</td>
<td>hospital</td>
<td>Hospital</td>
</tr>
<tr>
<td></td>
<td>text</td>
<td>name</td>
<td>What is the name of this hospital?</td>
</tr>
<tr>
<td></td>
<td>begin group</td>
<td>hiv_medication</td>
<td>HIV Medication</td>
</tr>
<tr>
<td></td>
<td>select_one yes_no</td>
<td>have_hiv_medication</td>
<td>Does this hospital have HIV medication?</td>
</tr>
<tr>
<td></td>
<td>end group</td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>end group</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
&nbsp;
<h1 dir="ltr">Grouping Questions on a Single Screen</h1>
By setting a group's appearance column to field-list you can display multiple questions on a single screen of your survey.
<div dir="ltr">
<table>
<tbody>
<tr>
<td>survey</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>type</td>
<td>name</td>
<td>label</td>
<td>appearance</td>
</tr>
<tr>
<td></td>
<td>begin group</td>
<td>respondent</td>
<td>Respondent</td>
<td>field-list</td>
</tr>
<tr>
<td></td>
<td>text</td>
<td>name</td>
<td>Enter the respondent’s name</td>
<td></td>
</tr>
<tr>
<td></td>
<td>text</td>
<td>position</td>
<td>Enter the respondent’s position within the school.</td>
<td></td>
</tr>
<tr>
<td></td>
<td>end group</td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
&nbsp;
<h1 dir="ltr">Skipping Questions</h1>
One great feature of ODK Collect is the ability to skip a question based on the response to a previous question. Below is an example of how to do this using XLSform:<strong><strong> </strong></strong>
<div dir="ltr">
<table><colgroup> <col width="63" /> <col width="59" /> <col width="57" /> <col width="191" /> <col width="254" /></colgroup>
<tbody>
<tr>
<td>survey</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>type</td>
<td>name</td>
<td>label</td>
<td>relevant</td>
</tr>
<tr>
<td></td>
<td>select_one yes_no</td>
<td>likes_pizza</td>
<td>Do you like pizza?</td>
<td></td>
</tr>
<tr>
<td></td>
<td>select_multiple pizza_toppings</td>
<td>favorite_topping</td>
<td>What is your favorite topping?</td>
<td>selected(${likes_pizza}, ‘yes’)</td>
</tr>
</tbody>
</table>
</div>
(choices worksheet ommitted; see above). This will ask the respondent, “Do you like pizza?” and ask which topping the respondent likes if he/she like pizza (and skips the question otherwise). The entry in the ‘relevant’ column is a true or false XPath expression. When the expression evaluates to true the question will be asked, otherwise it will be skipped. XLSforms have some convenient syntax so you don’t have to put the XPath in for the question likes_pizza, instead you can put ${likes_pizza} and the XLSform converter will replace ${likes_pizza} with the absolute XPath to the question named likes_pizza. Here are a couple additional examples of relevance formulas: <code> ${number_x}=${number_y} selected(${select_question}, 'option') </code> For more on proper XPath expressions, see this page: <a href="https://bitbucket.org/javarosa/javarosa/wiki/buildxforms">https://bitbucket.org/javarosa/javarosa/wiki/buildxforms</a>
If you want to skip a group of questions put the relevant attribute on a group like follows:
<div dir="ltr">
<table><colgroup> <col width="168" /> <col width="64" /> <col width="256" /> <col width="109" /></colgroup>
<tbody>
<tr>
<td>type</td>
<td>name</td>
<td>label</td>
<td>relevant</td>
</tr>
<tr>
<td>integer</td>
<td>age</td>
<td>How old are you?</td>
<td></td>
</tr>
<tr>
<td>begin group</td>
<td>child</td>
<td>Child</td>
<td>${age} &lt;= 5</td>
</tr>
<tr>
<td>integer</td>
<td>muac</td>
<td>Record this child’s mid-upper arm circumference.</td>
<td></td>
</tr>
<tr>
<td>select_one yes_no</td>
<td>mrdt</td>
<td>Is the child’s rapid diagnostic test positive?</td>
<td></td>
</tr>
<tr>
<td>end group</td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
&nbsp;
<h1 dir="ltr">Constraining Responses</h1>
&nbsp;
<div dir="ltr">
<table><colgroup> <col width="60" /> <col width="60" /> <col width="53" /> <col width="133" /> <col width="318" /></colgroup>
<tbody>
<tr>
<td>survey</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>type</td>
<td>name</td>
<td>label</td>
<td>constraint</td>
</tr>
<tr>
<td></td>
<td>integer</td>
<td>age</td>
<td>How old are you?</td>
<td>. &lt;= 150</td>
</tr>
</tbody>
</table>
</div>
Here we’ve put a constraint on age so that no one can be older than 150 years. If the enumerator puts 151 ODK Collect will not allow the enumerator to swipe to the next question. The column ‘constraint’ takes an XPath expression. A question is accepted if the ‘constraint’ column evaluates to true. Generally, a constraint pops up a default message telling the enumerator that he/she cannot go forward, but a constraint_message column can override this message on a question-by-question basis. <a name="Multiple_Language_Support"></a>
<h1 dir="ltr">Multiple Language Support</h1>
It’s easy to add multiple languages to a survey. You simply have to name your label::language1 label::language2 etc., and your surveys will be available on multiple languages. To select a different language on the phone, press the Menu key, and the “Change Language” option. For the form below, “English” and “Español” will show up as the possible options.<strong><strong> </strong></strong>
<div dir="ltr">
<table><colgroup> <col width="63" /> <col width="64" /> <col width="54" /> <col width="133" /> <col width="153" /> <col width="181" /></colgroup>
<tbody>
<tr>
<td>survey</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>type</td>
<td>name</td>
<td>label::English</td>
<td>label::Español</td>
<td>constraint</td>
</tr>
<tr>
<td></td>
<td>integer</td>
<td>age</td>
<td>How old are you?</td>
<td>¿Cuántos años tienes?</td>
<td>. &lt;= 150</td>
</tr>
</tbody>
</table>
</div>
Adding a hint in a different language in a hint, or adding specific media files for a given language is also possible; you simply use the ::language construct. See the <a href="https://docs.google.com/spreadsheet/ccc?key=0AgpC5gsTSm_4dDRVOEprRkVuSFZUWTlvclJ6UFRvdFE">xlsform standard document</a> to see exactly what kinds of column headers can accept a language modification.
<h1 dir="ltr">Formulas</h1>
Formulas are used in the constraint, relevant and calculate columns. Formulas are composed of functions and operators (+,*,div,etc) that are for the most part derived from the XPath specification. The formula evaluation functionality in ODK is provided by Javarosa. <a href="https://bitbucket.org/javarosa/javarosa/wiki/xform-jr-compat#!paths-and-expressions">Documentation of the functions supported by Javarosa is available here.</a> <a href="http://www.w3schools.com/xpath/xpath_operators.asp">The XPath operators are documented here.</a>
<h1 dir="ltr">Calculates</h1>
Your survey client can perform calculations using the values of preceding questions. In most cases this will require use of a calculate question. For example, in the survey below, we have calculated the tip and shown it to the surveyor. Our survey sheet will look like this:
<div dir="ltr">
<table><colgroup> <col width="68" /> <col width="97" /> <col width="97" /> <col width="239" /> <col width="96" /></colgroup>
<tbody>
<tr>
<td>survey</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>type</td>
<td>name</td>
<td>label</td>
<td>calculation</td>
</tr>
<tr>
<td></td>
<td>decimal</td>
<td>amount</td>
<td>What was the price of the meal?</td>
<td></td>
</tr>
<tr>
<td></td>
<td>calculate</td>
<td>tip</td>
<td>(Label is not required because calculates do not display any content.)</td>
<td>${amount} * 0.18</td>
</tr>
<tr>
<td></td>
<td>note</td>
<td>display</td>
<td>18% tip for your meal is: ${tip}</td>
<td></td>
</tr>
</tbody>
</table>
</div>
&nbsp;
<h1 dir="ltr">Media</h1>
You can also make questions that show the user an image, a video or an audio file as a way of asking a question. In order to do this, you will need to put the media in /odk/forms/formname-media folder on your phone, and reference their filenames from xlsform in a media column.
<div dir="ltr">
<table><colgroup> <col width="63" /> <col width="64" /> <col width="54" /> <col width="133" /> <col width="153" /> <col width="181" /></colgroup>
<tbody>
<tr>
<td>survey</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>type</td>
<td>name</td>
<td>label</td>
<td>media::image</td>
<td>media::video</td>
</tr>
<tr>
<td></td>
<td>note</td>
<td>media_example</td>
<td>Media example</td>
<td>example.jpg</td>
<td>example.mp4</td>
</tr>
</tbody>
</table>
</div>
&nbsp;
<h1 dir="ltr">Settings Worksheet</h1>
You can include a settings worksheet in your xls file similar to the following:
<table><colgroup> <col width="63" /> <col width="64" /> <col width="54" /> <col width="133" /> <col width="153" /> <col width="181" /></colgroup>
<tbody>
<tr>
<td>settings</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>form_title</td>
<td>form_id</td>
<td>public_key</td>
<td>submission_url</td>
<td>default_language</td>
<td>version</td>
</tr>
<tr>
<td></td>
<td>example title</td>
<td>example_id</td>
<td>IIBIjANBg...</td>
<td>https://example-odk-aggregate.appspot.com/submission</td>
<td>English</td>
<td>2</td>
</tr>
</tbody>
</table>
They do the following: form_title: The name of the form presented to users. form_id: The name used to identify the form submission_url: The url of a server that submitted forms are to be sent to. public_key: If form instances are to be encrypted, a public key needs to be included in the form. default_language: In localized forms, this sets which translation should be used as the default. None of these settings are required.
<h1 dir="ltr">More Resources</h1>
Your first stop for more resources should be <a href="http://formhub.org/formhub_u/">formhub university</a>, an account on formhub with many forms that you can download and inspect to learn about features. The <a href="https://docs.google.com/spreadsheet/ccc?key=0AgpC5gsTSm_4dDRVOEprRkVuSFZUWTlvclJ6UFRvdFE">XLSform standard document</a> can guide you through the specific input types, column headers, and so on that are legitimate syntax in XLSforms. If you are still confused, you can just email <a href="mailto:opendatakit@googlegroups.com">opendatakit@googlegroups.com</a>, or search the list for previous threads which may have answered your question. If you want to dig in deeper to understand xforms and go beyond xlsforms, here are some resources to understand them:
<ul>
<li>Form guidelines: <a href="http://code.google.com/p/opendatakit/wiki/XFormDesignGuidelines">http://code.google.com/p/opendatakit/wiki/XFormDesignGuidelines</a></li>
<li>Form design tutorial: <a href="https://bitbucket.org/javarosa/javarosa/wiki/buildxforms">https://bitbucket.org/javarosa/javarosa/wiki/buildxforms</a> </li>
<li>Sample forms: <a href="http://code.google.com/p/opendatakit/source/browse/?repo=forms">http://code.google.com/p/opendatakit/source/browse/?repo=forms</a> </li>
<li>XForms as supported by JavaRosa: <a href="https://bitbucket.org/javarosa/javarosa/wiki/xform-jr-compat">https://bitbucket.org/javarosa/javarosa/wiki/xform-jr-compat</a></li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment