There are many XLSForm advanced formatting options that will not work with CommCare. Please review the Known Limitations section below carefully before building forms using XLSForms!

 

Have a very long survey that you’d rather put into an Excel file before uploading in the form designer? You can use XLSForm, a free, online form-building tools that allow you to design your form in an Excel file, and then copy the created XML code into the CommCareHQ form designer. You can work on the Excel file offline and then upload it later.

You can see detailed instructions on how to set up the Excel file here

Overview

Build your form in Excel (following the instructions on http://opendatakit.org/use/xlsform/) and then upload it to XLSForm (http://opendatakit.org/xiframe/). You can then download the XForm and upload it into our form builder on HQ.

As you build your form you can test it online using the validation tool: https://opendatakit.org/use/validate/

  1. To load into CommCare, download the xform, a file that will end in .xml 
  2. Once in the app builder on CommCareHQ, create a new blank form. You can then upload the xform directly on the form settings page by clicking on the gear icon for the respective form, then selecting the "Actions" tab and "Upload".


 

Notes while building your form

Example: In CommCare's Form Builder, a display condition might look like: /data/pizza_fan = 'no' while in Formhub it would look like: ${pizza_fan} = 'no' - these will be updated when the xml file is generated


Using non-Latin languages and alphabets in the XLSform-XML process

If you choose to use XLSform's ability to handle multiple languages, by reading the XLSforms documentation and adding additional columns to contain the additional language content, please note the following:

Known Limitations

There are some things that don't work well when uploading a Formhub form to CommCare; these are active efforts to make these more compatible


Shortcut for creating the XLSForm format from CommCare's Export Form Contents

You may end up with an Excel form that is formatted like Export Form Contents as generated in CommCare, where all of the choices and questions are on one page. Below is a process to simplify breaking it into two pages.

The two parts of the process are:

1) split the choices from the questions (e.g. if the question is "What block do you live in" then the choices would be "Manjhanpur", "Mooratganj", "Kaneli", etc); and

2) format the sheets to match what XLSForm wants.

Here are the steps

1. Create a new column in excel that is the name of the question for the choices. To do this, you can use an if statement. If you have the question names in column C and the type of question in column H, then it would bethe following: =if(H3="Select Item",C3,C2) . This way, if you have a question, it will copy the question name, and if you have a choice, it will copy the value above it, which will be the question name from its question.

2. Create a new column in excel that equals 1 if the row is a choice and 0 if the row is a question.

3. Copy the two new columns that you created and paste special values them on top of themselves.

4. Sort the newly created column of 0's and 1's for question to split the questions and choices. Then copy the choices to their own sheet.

5. On the new choices sheet, get rid of the columns that you don't need anymore. Then change the column headings to match the format required.

6. Go back to the sheet with the list of questions. Use find and replace to change the names we have used for question type with what xforms uses (e.g. select_one rather than single select, text rather than text question. So find and replace all "single select" with "select_one").

7. Create a new column in excel. In this column, if the type of question is select_one or select_multiple, then the value should be "type nameofquestion". If it is any other type, then it should just be the type of question.

For example, if the type of question is select_one and the name of question is consent, then the value in this column should be "select_one consent". If it is a text question, then this value should be text. To do this, if the question name is in column B and the type of question is in column C, starting from the 3rd row, you can use =if(OR(C3="select_one",C3="select_multiple"), C3&" "&B3, B3).

8. Change the names of the columns to match the format  for xforms and delete any that you don't want. You will need to delete the validations if you have not edited them for xforms format.

9. Upload the form following the instructions above