> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/feature-management-experimentation/use-fme/warehouse-native-experimentation/setup/configure-assignments.md).

# Configuring Assignment Sources for Warehouse Native Experimentation

An Assignment Source defines where Harness FME reads experiment exposure (or impression) data from your data warehouse.

When creating or editing an Assignment Source, navigate to the **Experiments** page from the FME navigation menu and click the **Assignment Sources** tab. Then, click **+ Create assignment source**.

* **Name**: Enter a name for the assignment source.
* **Owners**: Assign one or more owners to make clear who is responsible for maintaining the assignment source.
* **Description**: Enter a description for the assignment source.

If you are using feature flags in Harness FME, you can export impression data from Harness FME to your warehouse and use that table as the assignment source for Warehouse Native Experimentation. See [Sending FME impressions to your warehouse](/feature-management-experimentation/use-fme/feature-management/monitoring-and-analysis/impressions.md#integrations-for-impression-data) for supported integrations and setup instructions.

To define the assignment source table, select **Table name** or **SQL query** in the `Source table` section.

{% tabs %}
{% tab title="Table Name" %}

#### Select a table <a href="#select-a-table" id="select-a-table"></a>

{% hint style="info" %}
Recommended if your data is already modeled into a clean impression/exposure table.
{% endhint %}

1. Select an existing table name directly from the schema.
2. Click **Test connection** to validate that Harness can query the table successfully before continuing.

With Assignment Sources configured, you can confidently create experiments, knowing all exposures are correctly captured, standardized, and reusable across analyses.
{% endtab %}

{% tab title="SQL Query" %}

#### Use a custom SQL query <a href="#use-a-custom-sql-query" id="use-a-custom-sql-query"></a>

{% hint style="info" %}
Recommended for light data transformations (e.g., extracting values from JSON), joins across multiple tables, or scoping to a subset of data.
{% endhint %}

You must have permissions to access all tables referenced in your query, based on the role and credentials configured when setting up your warehouse connection.

1. Write a SQL query that outputs the required fields.
2. After entering your query, click **Run query** to validate and preview results before proceeding.
   {% endtab %}
   {% endtabs %}

Harness shows a preview of the data returned from your table or query so you can validate that the expected rows and columns are present.

### Add field mappings <a href="#add-field-mappings" id="add-field-mappings"></a>

Define the following fields from your assignment source to Harness FME:

| Field                | Description                                                                                        |
| -------------------- | -------------------------------------------------------------------------------------------------- |
| Unique Identifier    | Maps to the column representing the unique key for user, account, or entity.                       |
| Impression Timestamp | Maps to the column representing when the user was assigned to a treatment.                         |
| Treatment            | Maps to the column that stores the treatment or experiment variant (e.g., `control`, `variant_a`). |

#### Configure your environments <a href="#configure-your-environments" id="configure-your-environments"></a>

{% tabs %}
{% tab title="Column Mapping" %}
Select an environment column and map its values to Harness FME environments. For example, select the `ENV_NAME` column and map its values (`US-Prod`, `UK-Prod`) to your Harness project’s `Production` environment and map the `Stg` values (`US-Stg`, `UK-Stg`) to your Harness project’s `Staging` environment.

This allows a single Assignment Source to span multiple environments.
{% endtab %}

{% tab title="Hardcoded Value" %}
Instead of selecting a column, set a fixed Harness FME environment for the entire Assignment Source (e.g., always `Production`).

This is recommended if the entire source table is scoped to one environment.
{% endtab %}
{% endtabs %}

#### Configure your traffic types <a href="#configure-your-traffic-types" id="configure-your-traffic-types"></a>

Similar to environments, traffic types can be set up in two ways:

{% tabs %}
{% tab title="Column Mapping" %}
Select a traffic type column (e.g., `ttid`) and map its values to Harness FME traffic types (e.g., `user`, `account`, or `anonymous`).

This is recommended if the same Assignment Source covers multiple population types.
{% endtab %}

{% tab title="Hardcoded Value" %}
Instead of selecting a column, set a fixed Harness FME traffic type for the entire Assignment Source (e.g., always `account`).

This is recommended if the entire source table is scoped to one population type.
{% endtab %}
{% endtabs %}

#### Add custom fields <a href="#add-custom-fields" id="add-custom-fields"></a>

Click **+ Add new custom field** to map any additional columns from your assignment source that are not included in the required field mappings. Select a column from the dropdown menu and enter a label for the field. Then, click **Save**.

Custom fields can be used to [filter data when creating or analyzing experiments](/feature-management-experimentation/use-fme/warehouse-native-experimentation/setup/experiments.md#create-an-experiment), for example, using the `experiment_id` or `targeting_rule`.

### Manage assignment sources <a href="#manage-assignment-sources" id="manage-assignment-sources"></a>

Assignment Sources can be reusable and standardized, or tailored to individual experiments depending on your organization’s needs:

* Reusable, standardized sources are recommended if you have a general impressions/exposures table.

  This approach makes setup faster and consistent across teams. Be mindful of potential query processing speed and warehouse costs when working with very large shared tables.
* Custom per-experiment sources are recommended if you want to scope data more tightly for privacy, relevancy, or performance.

  Limits experiment creators to a specific subset of data, reducing query volume and potential data access concerns.

Ultimately, it’s up to your organization whether to centralize around a single reusable source or create smaller, experiment-specific sources. Many teams use a mix of both strategies depending on scale and governance needs.

Once you've set up the assignment sources that best fit your workflow, you can manage them directly in Harness FME.

* **Edit**: You can update the table reference, query, or mappings as your data model evolves. Changes to an existing Assignment Source may disrupt any experiments that are actively using it.
* **Delete**: Remove outdated or misconfigured sources to reduce clutter and prevent accidental use.

{% hint style="warning" %}
**DELETING AN ASSIGNMENT SOURCE**

Deleting an Assignment Source that is currently used by an experiment will stop all calculations for that experiment. Historical results remain available, but the experiment will no longer update with new data.

If you want to continue the experiment, recreate the Assignment Source with the same configuration (pointing to the same table in your warehouse), then create a new experiment using that source. Assignment Sources cannot be replaced for an existing experiment.
{% endhint %}

### Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

If you encounter issues when configuring an Assignment Source:

<details>

<summary>Test Connection or Run Query Fails</summary>

1. Ensure your table or SQL query is valid and accessible with the credentials tied to your warehouse connection.
2. Check that you have permission to query all referenced schemas/tables.
3. Verify that the schema and table names are spelled correctly.

</details>

<details>

<summary>No Data Appears in Preview</summary>

If you are using a SQL query, try running it directly in your warehouse to confirm output.

</details>

<details>

<summary>Column Not Detected or Missing</summary>

Verify that your source table/query outputs the required columns: unique identifier, timestamp, and treatment.

</details>

<details>

<summary>Incorrect Environment or Traffic Type Mapping</summary>

1. Double-check that each warehouse value (e.g., `UK-Prod`) is mapped to the correct Harness environment (e.g., `Production`).
2. If everything should map to one environment or type, consider using the hardcoded value option instead of column mapping.

</details>

<details>

<summary>Assignment Source Not Showing in Experiment Setup</summary>

1. Make sure you clicked **Save** after configuration.
2. Confirm that the source hasn’t been deleted, disabled, or restricted to owners only.

</details>
