iTwin Forms icon

iTwin Forms

Comprehensive iTwin Forms API

Overview

This node integrates with the iTwin Forms API to allow users to interact with forms programmatically. Specifically, the "Download form as file" operation enables downloading a form by its ID in a specified file format, currently supporting PDF only. This is useful for automating the retrieval of form documents for archiving, sharing, or further processing.

Practical examples include:

  • Automatically downloading completed forms as PDFs for record-keeping.
  • Generating form files on-demand within an automation workflow.
  • Integrating form downloads into document management systems.

Properties

Name Meaning
ID The unique identifier of the form to download as a file.
File Type The type of file to download the form as. Currently, only "PDF" is supported.
Include Header Boolean flag indicating whether to include form metadata at the top of each page in the PDF. Defaults to true.

Output

The node outputs JSON data representing the result of the download operation. Typically, this will be the downloaded form file content or metadata about the file. If the node supports binary data output (not explicitly shown in the code), it would represent the actual file content (e.g., PDF bytes) suitable for saving or passing to other nodes.

Dependencies

  • Requires an API key credential for authenticating with the iTwin Forms API.
  • Depends on the FormsOpenApiInterpreter class to handle API operations and requests.
  • Requires proper configuration of the OAuth2 credentials for accessing the iTwin platform.

Troubleshooting

  • Unknown operation error: If the operation name is incorrect or unsupported, the node throws an error stating "Unknown operation". Ensure the operation parameter is set exactly to "download-form-as-file".
  • API authentication failures: Missing or invalid API credentials will cause authentication errors. Verify that the OAuth2 credentials are correctly configured and authorized.
  • Invalid form ID: Providing a non-existent or malformed form ID may result in API errors or empty responses. Confirm the form ID is correct.
  • Unsupported file type: Currently, only "PDF" is supported. Using other file types may cause errors or unexpected behavior.
  • Include Header parameter issues: Passing invalid values for the boolean "Include Header" property might lead to unexpected formatting in the downloaded PDF.

Links and References

Discussion