Serverless ODK deployments with Google Apps

Oct 26, 2016

ODK Collect now includes native support for Google Drive and Google Sheets. This powerful new feature helps organizations distribute blank forms via Google Drive and send submissions to Google Sheets without needing to use servers like ODK Aggregate.

To use Google Apps for your data collection campaign, you'll need to design an XForm and convert it to an XML form, upload that XML form to Google Drive for ODK Collect to download, and then create a blank Google Sheet that ODK Collect will submit the data to. These steps are detailed below.

A. Design an XLSForm with adjustments for Google Apps

  1. Ensure no repeats, audio, or video prompts are in the form. Groups, pictures, GPS prompts are perfectly fine.
  2. Ensure the form has less than 254 variables. Any non-group row (e.g., text, integer, select_one, geopoint, calculate, date) is considered a variable.
  3. Ensure only alphanumeric characters (123ABCdef) and dashes (-) are in the name column of the survey and choices sheets.
  4. Ensure the submission_url in the settings sheet is link to a Google Sheet. More on this below.

Need an example to start from? Download the Google Demo XLSForm file.

B. Create a blank Google Sheet to host data submissions from ODK Collect

  1. On your computer, log into a Google account and create the Google Sheet. Save it as whatever you'd like (e.g., Google Demo Results).
  2. Share this Google Sheet and give write privileges to any Google accounts in ODK Collect that will be submitting data.
  3. Copy the URL of the Google Sheet (e.g., https://docs.google.com/spreadsheets/d/1234/edit#gid=0) into the submission_url column of the settings sheet in your XLSForm.

C. Convert XLSForm to XML form and store in Google Drive for download to ODK Collect

  1. Convert the XLSForm to an XML form. We recommend XLSForm Offline.
  2. Once you have the XML, upload it to a Google Drive account.
  3. Share the XML and give view privileges to any Google accounts in ODK Collect that will be downloading the form.
  4. Your Drive should now have both files, your blank Sheet and the XML of your XLSForm.

D. Configure ODK Collect to work with Google Apps

  1. In ODK Collect's General Settings, select Drive and Sheets as your platform.
  2. Select a Google user account in ODK Collect that has view privileges to the XML form in Google Drive and write privileges to the Google Sheet.
  3. Leave the Google Sheets URL preference blank.

E. In ODK Collect, download form and submit data

  1. Now, Get Blank Form, download, fill, save, submit. If your device asks for permission to post Sheets, grant the permission.
  2. Go to your Sheet in your web browser to see your results.
  3. If the form has pictures, they will be posted to each submitters' Google Photos account and there will be links to the images placed in the sheet.

Upgrade to ODK Collect 1.4.11 to try serverless deployments of ODK using Google Drive and Sheets support. You'll find it works great for demos, trainings, and campaigns with simple forms!

Recent posts