iTwin Forms icon

iTwin Forms

Comprehensive iTwin Forms API

Overview

This node interacts with the iTwin Forms API, allowing users to retrieve detailed information about form definitions within an iTwin project. Specifically, the "Get form definition by ID" operation fetches the structure and metadata of a form based on its unique identifier. This is useful when you need to understand or manipulate the schema of a form, for example, to dynamically generate UI elements, validate data, or integrate form structures into other workflows.

Practical examples include:

  • Retrieving a form's layout and fields to display in a custom application.
  • Validating incoming form data against the form definition.
  • Automating documentation or reporting based on form schemas.

Properties

Name Meaning
ID The unique identifier of the form definition to retrieve. This ID should be obtained from the "Get project form definitions" endpoint or from a form data instance's formId property.

Output

The output is a JSON object representing the full form definition corresponding to the provided ID. This typically includes the form's metadata, field definitions, validation rules, and layout details. The exact structure depends on the iTwin Forms API response but generally provides all necessary information to understand the form's design and constraints.

No binary data output is indicated.

Dependencies

  • Requires an active connection to the iTwin Forms API.
  • Needs an API authentication token configured via OAuth2 credentials (referred generically as an API key credential).
  • The node uses an internal interpreter class to map operations to API calls.

Troubleshooting

  • Unknown operation error: If the specified operation name is incorrect or unsupported, the node will throw an error indicating "Unknown operation". Ensure the operation name matches exactly "get-form-definition-by-id".
  • Invalid or missing ID: Providing an empty or invalid form ID will likely cause the API call to fail. Verify that the ID is correct and was retrieved from a valid source.
  • Authentication errors: If the OAuth2 credential is not set up correctly or has expired, the node will fail to authenticate with the iTwin Forms API. Reconfigure or refresh the API authentication token.
  • API connectivity issues: Network problems or API downtime can cause failures. Check network access and iTwin service status.

If the node is set to continue on failure, errors will be returned in the output JSON under an error property with a descriptive message.

Links and References

Discussion