Briefcase

Use ODK Briefcase to easily gather and aggregate data from ODK Collect when you are without internet connectivity or do not want to set up an ODK Aggregate server (or other ODK-compatible server).

Additionally, you can use ODK Briefcase to incrementally pull data from ODK Aggregate (or push data to ODK Aggregate); the resulting local copy of your data can then archived or transformed by your own tools and transmitted to a third-party application.

ODK Briefcase can:

  1. pull blank forms and finalized forms (submissions) from ODK Collect or ODK Aggregate into a local ODK Briefcase Storage location.
  2. push blank forms and finalized forms (submissions) from the ODK Briefcase Storage location up to an ODK Aggregate 1.0 instance.
  3. export the finalized forms (submissions) to a CSV file for processing by other applications.
  4. Beginning with ODK Briefcase 1.4.4, there is a command line interface.

By pulling data into the local ODK Briefcase Storage location and then pushing data up to an ODK Aggregate instance, ODK Briefcase provides a mechanism to transfer data across incompatible upgrades of ODK Aggregate (e.g., between ODK Aggregate 0.9.8.1 and ODK Aggregate 1.0.x).

If a form is encrypted, ODK Briefcase is also the only mechanism to decrypt the finalized forms and generate a CSV of their unencrypted contents.

Installation

  1. Make sure Java 6 or higher is installed on the computer you plan to use. If it is not, download and install it.
  2. Navigate to Navigate to http://opendatakit.org/downloads/download-category/briefcase/ and download ODK Briefcase vN.N.N.jar.
  3. Double click the file to start. If that fails, try running 'java -jar path_to_jar' from the command line.
  4. Alternatively, for command line operation, type java -jar path_to_jar -help for help on the command line interface.

Upon first starting, Briefcase will ask for the directory under which to create the ODK Briefcase Storage area. An ODK Briefcase Storage folder will be created here to hold all the blank forms and finalized forms (submissions). Once created, you can copy and transport this storage folder across systems, just like a briefcase of paper documents.

Usage

When pulling forms from ODK Aggregate, you can either leave the username blank if the anonymousUser is granted Data Viewer permissions, or specify an ODK Aggregate user (Account Type 'ODK') that has been granted Data Viewer permissions. ODK Briefcase does not work with Google accounts (Account Type 'Google').

When pushing forms to ODK Aggregate, you can either leave the username blank if the anonymousUser is granted Form Manager permissions, or specify an ODK Aggregate user (Account Type 'ODK') that has been granted Form Manager permissions. ODK Briefcase does not work with Google accounts (Account Type 'Google').

ODK Briefcase will abort a pull attempt if the local copy of the form definition file differs in any way from the copy being pulled from the server or ODK Collect device. In this case, if the changes only affect the question text and do not alter the structure of the collected data (or change the formId or version), you can create a new ODK Briefcase Storage area, pull data into that, then manually copy the instances from there into your original storage area. If you do this, and need to continue to incrementally pull data from that ODK Aggregate, you should keep this new ODK Briefcase Storage area for future pull attempts; as long as that storage area retains all copies of the data already fetched, incremental pulls can be efficiently performed; if the copies are missing, the data will be re-fetched in its entirety, which can be expensive and time consuming.

Similarly, ODK Briefcase will abort a push attempt if the form definition already on the ODK Aggregate server differs in any way from the form definition in the ODK Briefcase Storage area. In this case, if these changes do not affect the data model, you can make a copy of the storage area, replace the copy's form definition file with that from the server, and then push the data up from this storage area copy.

As a Replacement for ODK Aggregate

ODK Briefcase can pull data directly off ODK Collect devices, but does not support pushing blank forms to ODK Collect. To use ODK Briefcase as a replacement for ODK Aggregate, you must manually install the forms on your ODK Collect device.

To manually install forms onto your ODK Collect device:

  1. Connect the device to your computer with a USB cable and either, for Android 2.x devices, turn on USB storage (on the Android device), or, for Android 4.x devices, choose to connect it as a Media device (on the computer).
  2. On the computer, copy the form definition and media folder to the /odk/forms directory. For Mac OS/X, if it is an Android 4.x device, you will need to use Android File Transfer to accomplish this.
  3. On Android 2.x, turn off USB storage.
  4. Run ODK Collect
  5. Choose "Fill Blank Form".

ODK Collect will scan the directory for new forms, parse them, and make them available in this list. It can take several moments for large forms to appear. When ODK Collect has completed scanning for new forms, it will display Finished scanning. All forms loaded. in the second line at the top of this screen.

The steps for pulling data directly into ODK Briefcase from your Android device differs between the Android 2.x and Android 4.x devices.

Pulling data directly from an Android 2.x device

These steps apply to Android 2.x devices. They are as follows:

  1. Ensure that all filled-in forms on ODK Collect are finalized. If they are not finalized, you should either delete them via ODK Collect's 'Delete Saved Form' button or make a back-up copy of the '/sdcard/odk' directory on your device, delete the incomplete forms in ODK Collect, follow the steps below and then restore to that back-up copy. If you want to do that, the OI File Manager app is very useful.
  2. Connect your Android device to your computer using a USB cable; on the Android device, choose to mount the drive (the mounted device only shows the files under the '/sdcard' directory, so when you are selecting 'odk', you are actually choosing the '/sdcard/odk' directory on the device, as seen by the OI File Manager application). Again, these instructions only apply to Android 2.x or earlier systems.
  3. Open ODK Briefcase, choose the "Pull" tab and on the "Pull data from:" drop-down, select "Mounted Android SD Card".
  4. Click "Choose..." and select the appropriate mounted SD card (it will appear as a drive on your Windows PC).
  5. Select the forms to pull and click the "Pull" button and the filled-in submissions that were copied off of the device will be loaded into ODK Briefcase's storage location.
  6. Confirm that the filled-in submissions have been successfully pulled into ODK Briefcase (e.g., by confirming a successful pull status or by verifying the data appear in a CSV export file).
  7. On the Android device, open ODK Collect and delete the filled-in forms via ODK Collect's "Delete Saved Form" button, selecting everything on the "Saved Forms" tab, and choosing "Delete Selected".

Notes:

The first step is important; ODK Briefcase does not discriminate between incomplete and finalized forms on the device. It will pull all data off of the device. This can cause problems during later pushes, and, especially, if you are encrypting your finalized forms. To keep your data set clean, you must ensure that all forms are complete before being pulled off of the device.

The last step is important; ODK Briefcase cannot discriminate between duplicates of the same filled-in form. After you pull the data into ODK Briefcase, it is important that you delete it from ODK Collect. Otherwise, the next time you follow this process, you will end up with two copies of the filled-in forms from the first pull, etc.

Pulling data directly from an Android 4.x device

ODK Briefcase does not work with the USB-mounted Media device (MTP) protocol, which replaced the USB-mounted drive protocol on Android 4.x devices. Unfortunately, MTP cannot be supported because there are no reliable cross-platform libraries for the MTP protocol.

The work-around is manually copy the '/sdcard/odk' directory (where ODK Collect stores all its data) from the Android device to your computer and use the 'Custom Path to ODK Directory' option within ODK Briefcase to pull that data into ODK Briefcase.

The recommended steps are:

  1. Ensure that all filled-in forms on ODK Collect are finalized. If they are not finalized, you should either delete them via ODK Collect's 'Delete Saved Form' button or make a back-up copy of the '/sdcard/odk' directory on your device, delete the incomplete forms in ODK Collect, follow the steps below and then restore to that back-up copy. If you want to do that, the OI File Manager app is very useful.
  2. Power off and then power on your Android device.
  3. Connect your Android device to your computer using a USB cable; on your computer, choose to mount it as a 'Media device.' Again, these instructions only apply to Android 4.x or later systems.
  4. Copy the 'odk' directory from the mounted MTP/Android device to a local hard drive. For Mac OS/X, you will need to use Android File Transfer. For Windows, you can just drag-and-drop the entire 'odk' directory into a folder on your PC (the mounted device only shows the files under the '/sdcard' directory, so when you are selecting 'odk', you are actually choosing the '/sdcard/odk' directory on the device, as seen by the OI File Manager application).
  5. Open ODK Briefcase, choose the "Pull" tab and on the "Pull data from:" drop-down, select "Custom Path to ODK Directory".
  6. Select the 'odk' folder you copied onto your local hard drive.
  7. Click the "Pull" button and the filled-in submissions that were copied off of the device will be loaded into ODK Briefcase's storage location.
  8. Confirm that the filled-in submissions have been successfully pulled into ODK Briefcase (e.g., by confirming a successful pull status or by verifying the data appear in a CSV export file)
  9. On the Android device, open ODK Collect and delete the filled-in forms via ODK Collect's "Delete Saved Form" button, selecting everything on the "Saved Forms" tab, and choosing "Delete Selected".

Notes:

The first step is important; ODK Briefcase does not discriminate between incomplete and finalized forms on the device. It will pull all data off of the device. This can cause problems during later pushes, and, especially, if you are encrypting your finalized forms. To keep your data set clean, you must ensure that all forms are complete before being pulled off of the device.

The second step is important; the MTP connection may show an out-of-date view of the files on your Android device. Power cycling your device ensures that it will show the current set of files on your device.

The last step is important; ODK Briefcase cannot discriminate between duplicates of the same filled-in form. After you pull the data into ODK Briefcase, it is important that you delete it from ODK Collect. Otherwise, the next time you follow this process, you will end up with two copies of the filled-in forms from the first pull, etc.

Useful Notes

  1. The developer wiki has release notes.