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.
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:
Create Your Form for Data Collection & Submissions
Log in to Google Drive with your Google account.
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.
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).
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.
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.
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:
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
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”.
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.
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.
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
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.
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
Open the ODK Collect app
Click on the Menu (three dots in the upper right corner)
Click on General Settings
Under Server Settings, click on Platform so you can change the destination path for where your ODK Collect data will be sent.
Select "Google Drive, Google Sheets"
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.)
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.
Hit the back button to return to the main menu.
Collect Data Using ODK Collect
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.
Searching for forms: It’s faster to search for forms than to browse for forms.
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.
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.
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.
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.
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
Go to your submission Sheet to view your data. You don’t need to refresh the page to see new data streaming in.
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.
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.
- See all tutorials.