-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
4,456 additions
and
4,256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,49 @@ | ||
--- | ||
title: Open Data Kit (ODK) | ||
title: ODK | ||
--- | ||
|
||
## Open Data Kit (ODK) Collect | ||
|
||
To bypass ODK Aggregate and submit forms directly to OpenFn make the following | ||
changes in your ODK Collect app. | ||
|
||
1. Select `General Settings`. | ||
2. Select `Server Settings`. | ||
3. Under `Type`, select `Other`. | ||
4. Under `URL`, enter `https://www.openfn.org | ||
5. Under `Submission path`, enter `/inbox/your-unique-inbox-url` (you can copy | ||
this from your OpenFn Inbox). | ||
6. Optional: If you have enabled auth methods on your inbox, enter your | ||
`username` and `password` on this same screen. | ||
|
||
Note that you cannot load forms from OpenFn. Forms must be loaded directly via | ||
[ODK's direct method](https://docs.opendatakit.org/collect-forms/#loading-forms-directly), | ||
which allows you to send forms as files via email/Whatsapp. Users can then | ||
choose to download the files and save them in the `odk/ forms` folder on their | ||
mobile. | ||
|
||
Note that if you want to reverse this setup and configure ODK Collect to | ||
re-connect to your Aggregate instance again:` | ||
|
||
1. Go back to `General Settings`. | ||
2. Select `Server Settings`. | ||
3. Under `Type`, select `ODK Aggregate`. | ||
4. Under `URL`, enter `Your Aggregate URL` | ||
5. Under `Submission path`, enter `/submissions`. | ||
6. Enter your ODK Aggregate `username` and `password` on this same screen. | ||
|
||
## Open Data Kit (ODK) Aggregate | ||
|
||
1. To new submissions from ODK in real-time, click the "Form Management" tab at | ||
the top of your Aggregate interface. | ||
2. Click "Publish" next to the form you'd like to publish to OpenFn. | ||
3. A dialogue box will open. | ||
4. In the "Publish To:" picklist, select `Z-ALPHA JSON Server`. | ||
5. Choose which data to publish in the "Data to Publish:" picklist. You may: | ||
**"Upload Existing Data ONLY"** (ideal for migrations of finished data sets), | ||
**"Stream New Submission Data ONLY"** (ideal for new projects), or **"BOTH | ||
Upload Existing & Stream New Submission Data"** (ideal for connecting ongoing | ||
projects which are already running). | ||
6. In the "URL to publish to:" text box, enter your OpenFn Inbox UUID. (e.g., | ||
`https://www.openfn.org/inbox/8ad63a29-mUCh-sEcRET-cODes-wOW`) | ||
7. Leave "Authorization token:" blank. | ||
8. Leave "Include Media as:" set to "Links(URLs) to Media". | ||
9. Click "Publish" and enter your email address in the dialogue box. | ||
10. Click the "Published Data" tab under "Form Management" and select your form | ||
to view the status of your publisher. You can also now check your OpenFn | ||
inbox to see ODK submissions arrive. | ||
# App Overview | ||
|
||
[ODK](https://getodk.org) is a data collection platform used by researchers, | ||
field teams, and other professionals to collect they data they need wherever it | ||
is. | ||
|
||
# Integration Options | ||
|
||
In order to fetch data from an ODK Central, you must run a scheduled job with a | ||
cron trigger using the `odk` adaptor. | ||
|
||
Here's an example of a job that gets submission data. | ||
|
||
```js | ||
getSubmissions($.projectId, $.xmlFormId); | ||
``` | ||
|
||
Every time this job runs it will get of all submissions and write them to | ||
`state.data`, leaving your state object looking like this: | ||
|
||
```json | ||
{ | ||
"data": [ | ||
{ | ||
"__id": "uuid:85cb9aff-005e-4edd-9739-dc9c1a829c44", | ||
"age": 25, | ||
"meta": { | ||
"instanceID": "uuid:85cb9aff-005e-4edd-9739-dc9c1a829c44" | ||
}, | ||
"name": "Bob" | ||
}, | ||
{ | ||
"__id": "uuid:297000fd-8eb2-4232-8863-d25f82521b87", | ||
"age": 30, | ||
"meta": { | ||
"instanceID": "uuid:297000fd-8eb2-4232-8863-d25f82521b87" | ||
}, | ||
"name": "Alice" | ||
} | ||
], | ||
"response": { | ||
/* ODK response headers, code and context*/ | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.