Automation Solution for �Rapid Kobo Form Deployment
Last Updated: October 2021
Confidential Open Function Group Version 2.0
Confidential Open Function Group Version 2.0
Rapid Kobo Deployment Form Automation
Don’t have a destination database configured yet? Not sure how to structure your data?
→ Go from… Kobo form → Database configuration + Integration job in minutes!
⚡
✨
✨
Delivers...
This automated is powered by multiple OpenFn jobs. Job “A1” triggers the others…
Rapid Kobo Deployment Form Automation
Don’t have a destination database configured yet? Not sure how to structure your data?
→ Go from… Kobo form → Database configuration + Integration job in minutes!
⚡
✨
✨
Delivers...
This automated is powered by multiple OpenFn jobs. See below for the technical details.
The original requirements.
From WCS….
Confidential Open Function Group Version 2.0
Automation to sync Kobo forms to DB metadata...
OpenFn will auto-generate SQL scripts to create database tables and columns that reflect the Kobo form structure.
Confidential Open Function Group Version 2.0
Automated vs. Manual Admin Steps
Confidential Open Function Group Version 2.0
Kobo “select” questions → DB Lookup Tables
region select_one �landscape select_multiple
Confidential Open Function Group Version 2.0
Syncing Metadata�Automation to configure DB metadata & integration scripts
Confidential Open Function Group Version 2.0
New Kobo Forms: Generating new metadata...
Confidential Open Function Group Version 2.0
A1: Generate Jobs, DB Tables, & Dictionary
Enter forms into job “A1” in order to:�1. Generate SQL based on the �form definition �2. Generate new OpenFn job �(to later sync data)
3. Export the Kobo form definition� (to prepare to later sync with the DB’s Data Dictionary)
Confidential Open Function Group Version 2.0
A3: Generates SQL Script
You can choose…
Confidential Open Function Group Version 2.0
Default job options:
{ writeSql: true, execute: false }
A4: Generates OpenFn Job
A4 run will include the name of the job.�Once created...
Confidential Open Function Group Version 2.0
More on the Kobo <> SQL sync.
Mapping Input: �{ “p1”: “WCSPROGRAMS”, �“p2”: “marche”, �“tableId: “MarketSurvey” } �→ outputs: WCSPROGRAMS_marche_MarketSurvey
{formName_groupName}
{formName_groupName}
Confidential Open Function Group Version 2.0
p1_p2_tableId
�uuid
jsonb (full JSON export)
Q1...
Kobo {FormName}
Q1�Q2�> repeat groupName
>> nested groupName�
p1_p2_{NestedRGroupName}
p1_KoboData
�datasetId�formName�...
p1_p2_{RepeatGroupName}
A5: Prepare Form for Data Dictionary
A5 job run is the last step triggered in the automation flow. It will…�
Confidential Open Function Group Version 2.0
Job A5 “Prepare Form for Data Dictionary” will sync the Kobo metadata to 3 tables in the connected database:
See this spreadsheet for the specification for how these tables are configured: https://docs.google.com/spreadsheets/d/1MemLYtWkzQosf0jlpVnWLepAuwnUHohCCcUG4tE4MR8/edit#gid=151768242
A5: Prepare Form for Data Dictionary
Confidential Open Function Group Version 2.0
If you would like the Automation solution to continually change for changes to Kobo form metadata…
A5: Prepare Form for Data Dictionary
Confidential Open Function Group Version 2.0
Syncing Data
Confidential Open Function Group Version 2.0
Ready to sync data...
Once you have…
… the target metadata is now set up!��Now you are ready to sync data.
Confidential Open Function Group Version 2.0
Sync Data (Kobo submissions)
You can choose to…�1. Run forms in a one-time sync to migrate historical data after a specific date. (Use this option for archived forms or for migration of historical data before today’s date.)�
2. Add forms to a job that runs on an ongoing basis (e.g., every 3 hrs) to regularly check for new submissions. (Use this option for forms where data collection is active and ongoing.)
Confidential Open Function Group Version 2.0
Kobo Metadata & �Form Management
“We will define the table names and field names based on the Kobo form “ →
What metadata in the Kobo forms should be used to define the DB configuration?
Confidential Open Function Group Version 2.0
WCS Kobo form management.
Confidential Open Function Group Version 2.0
Available Kobo metadata.
Confidential Open Function Group Version 2.0
How to add Kobo metadata to the form definition?
Confidential Open Function Group Version 2.0
Adding a “Calculate” field through the Kobo form builder
Adding a “Calculate” field in XLSForm