--- title: "Apply enrichment rule to specific target datasource records" slug: "apply-enrichment-rule-to-specific-target-datasource-records" description: "Learn how to set up enrichment rules for data quality policies using key fields, manually defined relations, and dynamic queries to enhance your target datasource." tags: ["Concept", "Data Quality Studio", "DQS"] updated: 2026-03-20T09:14:44Z published: 2026-03-20T17:44:40Z canonical: "docs.staedean.com/apply-enrichment-rule-to-specific-target-datasource-records" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.staedean.com/llms.txt > Use this file to discover all available pages before exploring further. # Apply enrichment rule to specific target datasource records For a data quality policy, you can set up an enrichment rule. For an enrichment rule, you can define to which target datasource records the enrichment rule applies. To apply an enrichment rule to specific target datasource records, you can use: - Key fields. - Manually defined field relations. - A dynamic query. ### Key fields For an enrichment rule, you can use key fields to identify records in the target datasource. The key fields setup defines to which target datasource records the enrichment rule applies. On the **Target datasource** page, for each target datasource, you can create the key fields. As a result, the key fields are added to the **Enrichment lines** of the applicable enrichment rule. For each key field, a key icon is shown in the **Key** field of the **Enrichment line**. For a 'key-field' enrichment line, you can use any value type to define the applicable target datasource records. You cannot use a key field to set a value in the target datasource. > [!NOTE] > Note > > - You can use 'key-field' enrichment lines in combination with 'has-relation' enrichment lines. > - If an enrichment rule is applied, and the target record, as defined by the 'key-field' enrichment lines: > - Exists, the target record is updated. > - Does not exist, the target record is created. ### Manually defined field relations For an enrichment rule, you can use manually defined field relations to identify records in the target datasource. The manually defined field relations setup defines to which target datasource records the enrichment rule applies. You can use manually defined field relations, for example, if no key fields are defined, or if you want to define other field relations than defined by the key fields. On the **Data quality policies** page, to an enrichment rule, you can add an enrichment line, and mark it as '**Has relation**'. For a 'has-relation' enrichment line, you can use any value type to define the applicable target datasource records. You cannot use a 'has-relation' enrichment line to set a value in the target datasource. > [!NOTE] > Note > > - You can use 'has-relation' enrichment lines in combination with 'key-field' enrichment lines. > - If an enrichment rule is applied, and the target record, as defined by the 'has-relation' enrichment lines: > - Exists, the target record is updated. > - Does not exist, the target record is created. ### Dynamic query For an enrichment rule, you can define other target datasources than the source datasource. For each other target datasource, you can define a dynamic query. The dynamic query defines to which target datasource records the enrichment rule applies. > [!NOTE] > Note > > If an enrichment rule is applied and a dynamic query is defined for a target datasource: > > - The dynamic query is used to define the applicable target datasource records. The setup of 'key-field' and 'has-relation' enrichment lines is ignored. > - And the target record, as defined by the dynamic query: > - Exists, the target record is updated. > - Does not exist, nothing is done. ## Related - [Set up target datasource](/set-up-target-datasource.md) - [Set up enrichment line of type Fixed value](/set-up-enrichment-line-of-type-fixed-value.md) - [Set up enrichment line of type Data query](/set-up-enrichment-line-of-type-data-query.md) - [Set up enrichment line of type Transformation list](/set-up-enrichment-line-of-type-transformation-list.md) - [Set up enrichment line of type Number sequence](/set-up-enrichment-line-of-type-number-sequence.md) - [Set up enrichment line of type Web service response](/set-up-enrichment-line-of-type-web-service-response.md) - [Set up enrichment line of type Custom](/set-up-enrichment-line-of-type-custom.md) - [Set up enrichment line of type Enable/Disable](/set-up-enrichment-line-of-type-enable-disable.md) - [Set up dynamic queries - Data Quality Studio](/set-up-dynamic-queries-general.md)