ODK Collect and Google Drive Integration to Store and Manage Your Data

Open Data Kit Collect (ODK Collect) is a free, open source app available in the Google Play Store for customizable data collection in an offline environment. When using ODK Collect, you have several options for where to send the data you’ve collected in the field: ODK Aggregate hosted on Google App Engine, or your own server, among others. One of the simpler options is to connect to Google Drive, allowing ODK Collect to access forms in your Google Drive account and send data collected on an Android device directly to Google Sheets.

This makes setting up a mobile data collection effort simple. Upload your ODK forms to Google Drive and ODK Collect will find them. Then, collect data on your mobile device offline in the field. When you’re back online, send it to Google Sheets. If your form includes photos, they will be stored unlisted on your Google Photos Album Archive and linked to from Google Sheets. This is a simple, user-friendly way to manage and store your ODK data without having to set up a server like ODK Aggregate. To learn more about ODK, view recent updates, more tutorials, and to contribute to the project, visit www.opendatakit.org and learn more from our tutorials.

Created by developers at the University of Washington's Computer Science and Engineering department and members of Change, Open Data Kit is an open-source project available to all.

Prerequisites

  • Familiarity with ODK Collect (if you want a refresher, look at our Getting Started with Mobile Data Collection Using ODK tutorial).
  • You’ll need a Google Account (or create a new Google Account)
  • You need an Android mobile device running Android OS of 1.6 or newer.
  • Note that several features of ODK and XLSforms are not supported with Google Sheets. Keep this in mind when designing your form:

    • Grouping questions are allowed, but no repeats.
    • You can have up to 254 variables (or questions within your form that are displayed on ODK Collect).
    • Photos are supported, but audio and video are not.
    • All other XLSforms features, including GPS location, are supported.

Create Your Form for Data Collection & Submissions

1. Log in to Google Drive with your Google account.

2. Next, we’ll create a form compatible with Google Sheets. Forms that will use Google Sheets for storing and hosting all the data are best constructed using XLSforms. (If you’re new to XLSforms, learn more at xlsforms.org.) Open this sample XLSform in Google Sheets.

3. Then click File > Make a Copy to get one you can customize. Rename the form with only alphanumeric characters (e.g. ABCdef123) and hyphens (-), being sure not to use any spaces in the name, special characters (e.g. my-odk-form).

4. Add a new tab to the Sheet and rename it (such as “results” or "submissions"), but don’t fill in anything else in the sheet. Again, only use alphanumeric characters and hyphens when renaming the tab.

5. Copy and paste the URL of your new, blank sheet (i.e. https://docs.google.com/spreadsheets/d/abcdefg1234567/edit#gid=0123456789) over into the “submission_url” cell of the Settings sheet. This sets the destination path for any user of this form, so the data they submit will go to the "results" sheet.

6. In order to allow users to download and fill out your form with ODK Collect, you will need to give them permission to access the Google Sheet. You can add specific users or you can give anyone with the link access. Here's how:

a. To give specific users access, click Share and add users’ emails, such as data collectors going out into the field, making sure they have Edit access

b. TIP: You can also turn link sharing on, allowing anyone with the link to edit the sheet. This would be useful if you want to have anonymous submissions to your ODK project (e.g. for a crowdsourcing project). In order for anyone to send data submissions, click Share, then “Get link and turn link sharing on.” Then change “Anyone with the link can view” to “Anyone with the link can edit”.

c. TIP: If you want to control who can edit the form or responses, you can protect the responses tab and control who has editing rights. Learn more about protecting a range or sheet.

d. TIP: If you want to control who can view or edit form responses, create a new, blank Google Sheet instead of a new tab within your form. Then, copy and paste that Sheet URL into the Settings > submission_URL cell in your form as before.

7. Now, you’ll convert your form to an .xml file which ODK Collect will display as a form on your Android device. In your form sheet, click File > Download as Microsoft Excel .xlsx

8. Use the ODK XLSform converter (or download XLSform Offline) to turn your Excel .xlsx sheet into an XML file. Download the resulting XML file.

9. Upload that XML file to your Google Drive account. It’s a good idea to use folders in Google Drive to organize all of your forms and make them easy to find.

10. Share the XML file with anyone else who will be collecting data and needs to download the form on their Android device.

Watch how to create a form for data collection and submissions. (1:45)


Install & Configure ODK Collect

1. Go to the Google Play Store and search for ODK Collect. If you already have ODK Collect installed, update it so you have the newest version.

2. Open the ODK Collect app

3. Click on the Menu (three dots in the upper right corner)

4. Click on General Settings

5. Under Server Settings, click on Platform so you can change the destination path for where your ODK Collect data will be sent.

6. Select "Google Drive, Google Sheets"

7. Next, click on Google Account and choose the account you wish to use with ODK Collect. This account will be where you store your forms on Google Drive and where your spreadsheet with all your and others’ ODK data submissions will live. (Do not enter anything in the "Google Sheets URL" field.)

a. TIP: The Android device needs to be connected to a Google Account with editing rights to the form you created. Add a Google Account to your Android phone.

8. Hit the back button to return to the main menu.

Collect Data Using ODK Collect

1. Click "Get Blank Form." Then click "My Drive." Click "Allow" to let ODK Collect access your Google Drive account. ODK Collect will search your Google Drive account for XML files, which will display after your list of folders. A good trick is to organize your XML files into a folder so you can find them easily.

a. Searching for forms: It’s faster to search for forms than to browse for forms.

b. Browsing My Drive or Shared With Me: you can browse My Drive or Shared With Me (e.g. if you’ve shared your form with data collectors, this is where they would go to navigate to your form, but search is faster). XML files will display underneath your folder directory.

2. Search for the form you just created by entering the form name in the search box. Click the check box on the right side and hit "Download Selected." You’ll see a window appear saying "Success" once the form completes downloading. Download your sample form that you just created.

3. In the main menu of ODK Collect, click "Fill Blank Form" and proceed to fill out your information. When complete, hit "Send Finalized Form" and your submission will appear in your Google Sheet.

a. TIP: The first time you send a submission to your new sheet, your device will ask for permission to submit to Google Drive. Click Allow to send data to your sheet.

b. TIP: If you encounter an error submitting to Sheets, try deleting other forms you’re no longer using. Main Menu > Delete Saved Form.

This video shows how to submit ODK Collect data to Google Sheets. (1:53)

View Your Data

  1. Go to your submission Sheet to view your data. You don’t need to refresh the page to see new data streaming in.
  2. If you’ve included a photo in your form, your sheet will include a link to the photo. Photos are sent to each user’s Google Photos Album Archive associated with their Google account in an unlisted album where only users with the link can view. Each photo will be stored in an album with the form name, so you can browse through photos submitted to one form.
  3. To visualize your data submissions on a map, you can use Google My Maps. Maps that you create are also stored in your Google Drive account, so all of your ODK data can be hosted, managed and visualized in one place. Follow step-by-step instructions to import info into Google Maps, or visit the Visualize Your Data on a Custom Map using My Maps tutorial. You can either download your data as a CSV file or import directly from Google Sheets.

 

Congratulations -- you are now using Google Drive to store and manage your ODK Collect data!

Discussion & Feedback

Have questions about this tutorial? Want to give us some feedback? Visit the Google Earth Outreach Discussion Group to discuss it with others.

What's Next?