Actions28
- Attachments Actions
- Comments Actions
- Import Actions
- Static Images Actions
- Forms Actions
- Delete form definition
- Update form definition metadata
- Get form definition by ID
- Add comment to form
- Get form data comments
- Download form as file
- Export forms to Storage
- Get form data details
- Update form data
- Delete form data
- Import form definition from another iTwin
- Get iTwin form definitions
- Add attachment to form
- Get form data attachments
- Create form data
- Get iTwin form data
- Get audit trail for form data
- List Groups Actions
- Templates Actions
- Workflows Actions
Overview
This node integrates with the iTwin Forms API, specifically enabling users to upload attachment files to a form data instance. It is useful in scenarios where form submissions require associated file uploads, such as uploading images, documents, or other media related to a particular form entry.
A practical example would be a construction project management workflow where field engineers submit inspection forms and attach photos or reports directly through the automation. This node handles the upload of those attachments by linking them to the correct form data and attachment metadata instances.
Properties
| Name | Meaning |
|---|---|
| ID | The ID of the form data instance for which to upload an attachment file. |
| Attachment ID | The ID of the previously created attachment metadata instance for which this file is being uploaded. |
| Options | Additional optional settings: |
| - Custom Payload | Allows overriding the request body with a custom JSON payload if enabled. Useful for advanced customization. |
Output
The node outputs JSON objects representing the response from the iTwin Forms API after attempting to upload the attachment file. The structure depends on the API response but generally includes confirmation details about the uploaded file or error information if the upload failed.
No binary data output is indicated by the source code or properties.
Dependencies
- Requires an API authentication token credential configured in n8n (referred generically as an API key credential).
- Depends on the iTwin Forms API being accessible.
- Uses an internal helper class (
FormsOpenApiInterpreter) to handle API operations and requests.
Troubleshooting
Common issues:
- Invalid or missing form data instance ID or attachment metadata ID will cause the upload to fail.
- Network or authentication errors if the API key credential is not set up correctly.
- Incorrectly formatted custom payload JSON can cause request failures.
Error messages:
"Unknown operation: upload-attachment-file"indicates the operation parameter was not recognized; ensure the operation name matches exactly.- Errors returned from the API are passed through; check the error message for details like invalid IDs or permission issues.
Resolutions:
- Verify that the form data instance ID and attachment metadata ID exist and are correct.
- Confirm API credentials are valid and have necessary permissions.
- If using custom payloads, validate JSON syntax before submission.
Links and References
- iTwin Developer Documentation
- Refer to the iTwin Forms API docs for detailed information on attachment upload endpoints and payload formats.