Skip to content

Importing an XLSForm

You can build a form in Excel — or take one a partner already uses in KoboToolbox, ODK Collect or SurveyCTO — and bring it into MERL Studio as a new instrument.

The format is XLSForm, the open standard documented at xlsform.org. It is an Excel workbook with three worksheets:

Worksheet Holds
survey One row per question, plus begin_group / end_group rows that divide the form into sections
choices The options for every single- and multi-select question, grouped by list_name
settings The form’s title, id and version. Optional
  1. Open a collection plan and go to the Instruments tab.
  2. Click Import XLSForm.
  3. Drop in your .xlsx file. If you are starting from scratch, use Download a blank XLSForm template first — it has every column this app reads, already in place.
  4. Review what was found, give the instrument a name, and click Create instrument.

Importing always creates a new draft instrument. Nothing that already exists is changed, and there is no mode that overwrites a form you have already built.

  • Sections — from begin_group and begin_repeat rows.
  • Questions — text, integer, decimal, single and multi select, date, time, date and time, location, photo, notes, calculations, and ranges.
  • Choices — with their labels, from the choices sheet.
  • Required — from the required column (yes, true or 1).
  • Hints — from the hint column.
  • Skip logic — from the relevant column, for the conditions the designer can express.
  • Validation — from the constraint and constraint_message columns.

The review step lists this for the file in front of you, but in general:

  • Question types with no equivalent — barcode, audio, video, file attachment, ranking, geotrace and geoshape, external choice lists, and the automatic metadata types (start, end, today, deviceid, username). These are skipped, and each one is named.
  • Complex conditions. Skip logic here is a list of simple tests joined with and. A relevant expression using or, a function, or a comparison such as >=, is dropped rather than approximated into something that would ask a different question of the respondent.
  • Conditions that look forwards. A question may only depend on an answer the respondent has already given. A relevant expression naming a later question is dropped.
  • Extra languages. An instrument holds one set of labels. If the file has label::English (en) and label::Français (fr), the language named in settings.default_language is imported and the others are left behind.
  • Repeat limits. A repeat_count that is a number becomes the section’s limit; one that is a formula is ignored. Indicator or attribute links inside a repeat are refused when you deploy, because those need one answer per submission.
  • Calculations. ${name} references become links to the questions they name. A function the formula language doesn’t have is reported on import, and that question stays blank.

Nesting is flattened. A group inside a group becomes two consecutive sections, in the order the questions appear, because an instrument is one level deep.

An XLSForm exported from MERL Studio carries a handful of extra merlstudio_ columns that ODK and Kobo ignore. They record the things the standard has no way to say: whether a select was really a grid or a Likert scale, which indicator a question feeds, which option is the “Other” escape hatch. Import the file back and those come with it.

Leave those columns alone if you edit the file. Delete one and the import still works — it just falls back to what the standard columns say, so a grid returns as a group of separate questions.

Two things never round-trip, whatever the file says:

  • The subject picker question itself. The file’s copy is ignored — but the form’s subject type does come back (from merlstudio_subject_types), and the picker is added back automatically for it.
  • Standardised assessments. Their scoring rules point at specific questions, which no spreadsheet can carry. An imported form is always an ordinary structured survey.

The merlstudio_indicator_code column links a question to an indicator by its code — the same code you see in the Indicator Registry, not an internal id. On import each code is looked up in this workspace. If it matches nothing, matches more than one indicator, or names an indicator the question type cannot produce a reading for, the review step says so and the question comes in unlinked.

merlstudio_subject_types (on the settings sheet) names the form’s subject record types, and merlstudio_attribute names the participant attribute a question fills in — both by the machine name you see in the Data Framework, not an internal id. On import they’re looked up in this workspace. A subject type that doesn’t exist is left off; an attribute that doesn’t exist on the participant subject type, doesn’t suit the question, or is already linked to an earlier question is left unlinked. The review step lists each one, and nothing blocks the import.

Problems that would produce a broken instrument block the import: a duplicate question name, a question with no name or type, a select naming a choice list that is not on the choices sheet, or a group that is never closed. Download the problems report to get your own file back with a column explaining what was wrong on each row.

Everything else is a note. Notes never block the import; they tell you what the instrument will be missing.