KoboToolbox 2 icon

KoboToolbox 2

Work with KoboToolbox forms and submissions

Overview

This node integrates with KoboToolbox, a platform for data collection via forms, to manage files associated with forms. Specifically, the "File" resource with the "Default" operation allows users to interact with files linked to a particular form. Common scenarios include listing all media files attached to a form, downloading specific files by name or ID, deleting files, and uploading new files either from binary data, text content, or URLs.

Practical examples:

  • Automatically download all media files from a selected KoboToolbox form to process or archive them.
  • Upload a new image or document file to a form programmatically.
  • Delete outdated or incorrect files from a form's media library.
  • Retrieve metadata about a specific file for reporting or validation purposes.

Properties

Name Meaning
Form Name or ID The identifier of the KoboToolbox form whose files you want to manage. Choose from the list or specify an ID using an expression.

Additional properties used internally (not listed here) relate to file selection (by name or ID), whether to download file content, binary property naming for downloaded files, file upload mode (binary, text, or URL), overwrite option, MIME type, file content, and file URL.

Output

The node outputs JSON data representing the files or the result of the performed file operation:

  • For listing files (getAll), it returns an array of file metadata objects.
  • For getting a single file (get), it returns the file metadata and optionally includes the file content as binary data under a user-defined binary property.
  • For creating files (create), it returns the metadata of the newly uploaded file.
  • For deleting files (delete), it returns a success confirmation or API response.

If files are downloaded, the node outputs binary data containing the actual file content, properly prepared for further use in workflows (e.g., saving to disk, sending via email).

Dependencies

  • Requires an active connection to the KoboToolbox API, authenticated via an API key credential configured in n8n.
  • Uses internal helper functions to make HTTP requests to KoboToolbox endpoints and to handle file downloads and uploads.
  • The node depends on the loadForms method to populate the list of available forms dynamically.

Troubleshooting

  • No file found matching name: When selecting a file by name, if no file matches the given name, the node throws an error. Ensure the file name is correct and exists in the specified form.
  • Authentication errors: If the API key credential is missing or invalid, requests will fail. Verify that the API key is correctly set up in n8n credentials.
  • Download failures: Network issues or permission restrictions may cause file content downloads to fail. Check network connectivity and API permissions.
  • Overwrite conflicts: When uploading a file with overwrite enabled, if the existing file cannot be deleted due to permissions or other issues, the upload may fail. Confirm that the API user has rights to delete files.

Links and References

Discussion