Technical Knowledge Base

XLS Form Question Types

You are here:
< Back

XLSForm supports a number of question types. These are just some of the options you can enter in the type column in the survey worksheet in your XLSForm:

Question Type


Answer Input Format


integer


Integer (i.e., whole number) input.


decimal


Decimal input.


range


Range input.


text


Free text response.


select_one[options]
Multiple choice question; only one answer can be selected.


select_multiple[options]
Multiple choice question; only one answer can be selected.


rank[options]
Rank question; order a list.


note


Display a note on the screen, takes no input.


geopoint


Collect a single GPS coordinate.


geotrace


Record a line of two or more GPS coordinates.


geoshape


Record a polygon of multiple GPS coordinates; the last point is the same as the first point.


date


Date input.


time


Time input.


dateTime


Accepts a date and a time input.


Image


Take a picture or upload an image file.


audio


Take an audio recording or upload an audio file.


video


Take a video recording or upload a video file.


file


Generic file input (txt, pdf, xls, xlsx, doc, docx, rtf, zip)


barcode


Scan a barcode, requires the barcode scanner app to be installed.


calculate


Perform calculations.


acknowledgement


Acknowledge prompt that sets value to “OK” if selected.


hidden


A field with no associated UI element


xml-external


Adds a reference to an external XML data file.


Multiple choice questions

XLSForm supports both select_one (select only one answer) and select_multiple (select multiple answers) questions. Writing a multiple choice question requires adding a choices worksheet to your Excel workbook. Here is an example of a select_one question:

type


name


label


select_one yes_no


likes_pizza


Do you like pizza?


list name


name


label


yes_no


yes


Yes


yes_no


no


No


Note that the yes_no in the survey worksheet must match the yes_no in the list name column in the choices worksheet. This ensures that the form displays the correct list of answer choices for a particular question.

We can also add multiple choice questions that allow multiple answers to be selected, like so:

type


name


label


select_multiple pizza_toppings


favorite_toppings


What are your favorite pizza toppings?


list name


name


label


pizza_toppings


cheese


Cheese


pizza_toppings


pepperoni


Pepperoni


pizza_toppings


sausage


Sausage


Specify other

For multiple choice questions, surveys often include an option of marking other when their answer choice is not listed. Then they are usually asked to specify the other option. This is possible through XLSForm by including or_other after the answer choice list name in the survey worksheet. The choices worksheet stays the same. See below:

type


name


label


select_multiple pizza_toppings or_other


favorite_topping


What are your favorite pizza toppings?


list name


name


label


list name


name


label


pizza_toppings


cheese


Cheese


pizza_toppings


pepperoni


Pepperoni


pizza_toppings


sausage


Sausage


 

Click to look at the complete pizza_questionnaire.

Caveat

When you export data using this or_other option, in the favorite_topping column, you will see a value other. A separate column will have the answer for the questions in which the user selected other. This makes data analysis more cumbersome, so we do not recommend the or_other construct for large scale data collection efforts. See the Relevant section below for an alternative method more appropriate for large scale projects.

Rank

The rank widget can be used to let respondents order a list of options. The answer is saved as an ordered, space-separated list of option values where all options are always included. The syntax is very similar to multiple-choice questions.

type


name


label


rank pizza_toppings


toppings


Order pizza toppings with your favorite on top


list name


name


label


pizza_toppings


cheese


Cheese


pizza_toppings


pepperoni


Pepperoni


pizza_toppings


sausage


Sausage


To prevent bias it is often recommended to use the randomize feature in conjunction with this widget.