metadata-models/docs/entities/form.md
The form entity is a core entity in DataHub's metadata model that enables structured metadata collection and compliance initiatives. Forms provide a centralized, template-based approach for capturing essential metadata across data assets through a collaborative, crowdsourced workflow.
Forms are identified by a unique string identifier that is chosen by the creator.
A form URN is structured as: urn:li:form:<form-id>
For example: urn:li:form:metadataInitiative2024
The form identifier should be meaningful and descriptive, typically representing the initiative or purpose of the form (e.g., piiClassification2024, dataQualityCompliance, retentionPolicyForm).
Forms are defined using the formInfo aspect, which contains all the core information about a form:
COMPLETION: Forms designed purely for collecting metadata fields on entitiesVERIFICATION: Forms used to verify that entities comply with a policy via presence of specific metadata fieldsSTRUCTURED_PROPERTY: Prompts to apply structured properties to entitiesFIELDS_STRUCTURED_PROPERTY: Prompts to apply structured properties to schema fields (columns) of datasetsHere's an example of form metadata:
<details> <summary>Python SDK: Create a form</summary>{{ inline /metadata-ingestion/examples/library/form_create.py show_path_as_comment }}
Forms can be assigned to entities in two ways:
dynamicFormAssignment aspect to automatically assign forms to entities matching certain criteriaThe dynamicFormAssignment aspect enables rule-based form assignment by specifying filters. Entities matching the filter criteria will automatically have the form applied. The filter supports:
This dynamic approach is particularly powerful for large-scale compliance initiatives where you want to apply forms to all assets of a certain type or within a specific domain.
<details> <summary>Python SDK: Assign forms dynamically with filters</summary>{{ inline /metadata-ingestion/examples/library/form_create_with_dynamic_assignment.py show_path_as_comment }}
When forms are assigned to entities (either explicitly or dynamically), the assignments are tracked via the forms aspect on the target entity. This aspect maintains:
This allows DataHub to provide progress tracking, notifications, and analytics about form completion across your data catalog.
Forms can have owners assigned through the standard ownership aspect. Owners of forms are typically the governance or compliance team members who are responsible for managing and maintaining the form.
{{ inline /metadata-ingestion/examples/library/form_add_owner.py show_path_as_comment }}
{{ inline /metadata-ingestion/examples/library/form_create.py show_path_as_comment }}
{{ inline /metadata-ingestion/examples/library/form_create_with_dynamic_assignment.py show_path_as_comment }}
{{ inline /metadata-ingestion/examples/library/form_assign_to_entities.py show_path_as_comment }}
{{ inline /metadata-ingestion/examples/library/form_remove_from_entities.py show_path_as_comment }}
Forms can be queried via the REST API to retrieve form definitions and check their assignment status.
<details> <summary>Query a form via REST API</summary>curl 'http://localhost:8080/entities/urn%3Ali%3Aform%3AmetadataInitiative2024'
This will return the form entity with all its aspects including formInfo, dynamicFormAssignment (if configured), and ownership.
curl 'http://localhost:8080/entities/urn%3Ali%3Adataset%3A(urn%3Ali%3AdataPlatform%3Asnowflake,mydb.schema.table,PROD)?aspects=forms'
This returns the forms aspect showing all incomplete and completed forms for the dataset.
Forms have several key integration points in the DataHub ecosystem:
Structured Properties: Forms primarily interact with structured properties through prompts. Each prompt can require users to fill out specific structured properties on entities or schema fields.
Assets (Datasets, Dashboards, Charts, etc.): Forms are assigned to data assets to collect metadata. The relationship is tracked through:
forms aspect on the target entitydynamicFormAssignment filter criteria on the formUsers and Groups: Forms are assigned to specific actors (users or groups) who are responsible for completing them. This creates a workflow where:
Domains and Containers: Forms can be automatically assigned based on domain or container membership, enabling governance teams to apply compliance requirements at the domain or container level.
Compliance Initiatives: Organizations create verification forms to ensure critical assets meet compliance requirements (e.g., PII classification, data retention policies)
Metadata Enrichment: Completion forms help gather missing documentation, ownership, and domain assignments for high-value assets
Governance Workflows: Forms enable systematic metadata collection by routing tasks to domain experts who are best positioned to provide accurate information
Quality Improvement: Forms can be used to incrementally improve metadata quality by focusing on the most important assets first
Currently, forms only support structured property prompts. Each prompt requires users to set values for structured properties on entities or their schema fields. Future extensions may include prompts for other metadata types (e.g., documentation requirements, tag requirements).
When using FIELDS_STRUCTURED_PROPERTY prompt types, these prompts should not be marked as required, as they apply to an indeterminate number of schema fields. The form is considered complete when users have appropriately responded to the field-level prompts.
Forms are assigned to entities through two independent mechanisms:
An entity can have the same form assigned through both mechanisms. The forms aspect on the entity consolidates all assignments regardless of how they were made.
Once a form is created and published, assignees will see it in their task queue. Deleting a form requires:
This two-step process ensures referential integrity across the metadata graph.