Authoring an XLSForm to Create a Basic Survey

There are countless ways to develop a survey, but none as comprehensive as the XLSForm. XLSForms are easy to author, and can be as simple or complex as needed to meet your goals.

There are two ways to author an XLSForm:

  1. Send your survey questions in any format to the LINKS team, and we'll develop an XLSForm for your project for a nominal setup fee.

  2. Develop an XLSForm yourself by following the instructions below.


To author an XLSForm, all you need is an excel document with 2 required tabs.

  • survey - This tab contains the bulk of the content for your survey, and gives the survey it's the overall structure.

  • choices - This tab specifies the options for multiple choice questions.

  • settings - This optional tab can be used to define the title and id of the survey, and other settings such as version numbers, encryption information, and default languages.


Each tab has a small set of required column names, and multiple optional columns that can be added to further customize your survey.



Survey Tab


Required Columns:

  • type - The type column defines the question type. Common question types are:

    • text: allows the user to enter freeform text

    • integer: allows the user to enter an integer

    • select_one: presents the user with a list of choices, and the ability to choose one.

    • geopoint: collects GPS coordinates of the users location.

    • Click here to more options for question types.



  • name - This column defines the unique variable name for that entry. No two questions can have the same name.

  • label - The label column defines the question that the user will be presented with upon completing the form.




Optional Columns:

  • hint - This column is used to display a hint to the user of the survey, and is commonly used if the question requires further clarification.

  • constraint - This column is used to define a constraint to the answer a user inputs. For example, if the question is asking for a day of the month, you might constrain the user to only enter integers between 1 and 31. The constraint_message column is used to display plain text if the user enters something that does not fall into the defined constraint. An example might be: "Response must be between 1 and 31." For more information about how to write a constraint, click here.

  • relevant - A great feature of XLSForms is the ability to implement skip logic. This is done in the relevant column by typing ${name}='response'. The below example shows that the user will only be asked their gender if they are 25 years old. For more examples of how to implement skip logic in this column, click here.

  • required - This column is used to define whether a question is required or not. Leaving this column blank will make the question optional. If a question should be required, write 'yes' in this column. To provide more context to the user, enter a plain text explanation in the required_message column. An example might be: "Sorry, this response is required."

  • To learn more about the possibilities of other optional columns, click here.




Choices Tab


Required Columns:

  • list name - This column groups together related answer choices for select_one and select_multiple question types.

  • name - The unique variable name for the answer choice.

  • label - The choice as displayed to the user.




Settings Tab


Columns:

  • form_title - This is the title of the survey, as displayed to the user. If this is left blank, the form_title becomes the same as the form_id.

  • form_id - This is the form id. It can not contain any spaces.

  • version - This column is set aside to keep track of the version of the XLSForm, and is especially handy if multiple people are collaborating on authoring an XLSForm. The version can be a string of up to 10 numbers. A common format is 'yyyymmddnn' where 'nn' is the version number of that particular day. For example '2017052901' is the 1st version on May 29, 2017.

  • To learn more about the possibilities of other optional columns, click here.




For more information on the possibilities of XLSForms, click here.