KoboToolbox#
Use the KoboToolbox node to automate work in KoboToolbox, and integrate KoboToolbox with other applications. n8n has built-in support for a wide range of KoboToolbox features, including creating, updating, deleting, and getting files, forms, hooks, and submissions.
On this page, you'll find a list of operations the KoboToolbox node supports and links to more resources.
Credentials
Refer to KoboToolbox credentials for guidance on setting up authentication.
Operations#
- File
- Create
- Delete
- Get
- Get Many
- Form
- Get
- Get Many
- Redeploy
- Hook
- Get
- Get Many
- Logs
- Retry All
- Retry One
- Submission
- Delete
- Get
- Get Many
- Get Validation Status
- Update Validation Status
Templates and examples#
Options#
Query Options#
The Query Submission operation supports query options:
- In the main section of the Parameters panel:
- Start controls the index offset to start the query from (to use the API pagination logic).
- Limit sets the maximum number of records to return. Note that the API always has a limit of 30,000 returned records, whatever value you provide.
- In the Query Options section, you can activate the following parameters:
- Query lets you specify filter predicates in MongoDB's JSON query format. For example:
{"status": "success", "_submission_time": {"$lt": "2021-11-01T01:02:03"}}
queries for all submissions with the valuesuccess
for the fieldstatus
, and submitted before November 1st, 2021, 01:02:03. - Fields lets you specify the list of fields you want to fetch, to make the response lighter.
- Sort lets you provide a list of sorting criteria in MongoDB JSON format. For example,
{"status": 1, "_submission_time": -1}
specifies a sort order by ascending status, and then descending submission time.
- Query lets you specify filter predicates in MongoDB's JSON query format. For example:
More details about these options can be found in the Formhub API docs
Submission options#
All operations that return form submission data offer options to tweak the response. These include:
- Download options lets you download any attachment linked to each particular form submissions, such as pictures and videos. It also lets you select the naming pattern, and the file size to download (if available - typically for images).
- Formatting options perform some reformatting as described in About reformatting.
About reformatting#
The default JSON format for KoboToolbox submission data is sometimes hard to deal with, because it's not schema-aware, and all fields are therefore returned as strings.
This node provides a lightweight opinionated reformatting logic, enabled with the Reformat? parameter, available on all operations that return form submissions: the submission query, get, and the attachment download operations.
When enabled, the reformatting:
- Reorganizes the JSON into a multi-level hierarchy following the form's groups. By default, question grouping hierarchy is materialized by a
/
character in the field names, for exampleGroup1/Question1
. With reformatting enabled, n8n reorganizes these intoGroup1.Question1
, as nested JSON objects. - Renames fields to trim
_
(not supported by many downstream systems). - Parses all geospatial fields (Point, Line, and Area question types) into their standard GeoJSON equivalent.
- Splits all fields matching any of the Multiselect Mask wildcard masks into an array. Since the multi-select fields appear as space-separated strings, they can't be guessed algorithmically, so you must provide a field naming mask. Format the masks as a comma-separated list. Lists support the
*
wildcard. - Converts all fields matching any of the Number Mask wildcard masks into a JSON float.
Here's a detailed example in JSON:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
With reformatting enabled, and the appropriate masks for multi-select and number formatting (for example, Crops_*
and *_sqm
respectively), n8n parses it into:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
What to do if your operation isn't supported#
If this node doesn't support the operation you want to do, you can use the HTTP Request node to call the service's API.
You can use the credential you created for this service in the HTTP Request node:
- In the HTTP Request node, select Authentication > Predefined Credential Type.
- Select the service you want to connect to.
- Select your credential.
Refer to Custom API operations for more information.