> ## Documentation Index
> Fetch the complete documentation index at: https://launchdarkly.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Assignment data sources

<View title="Developer" />

<View title="Federal docs">
  <Danger>
    **Experiments using warehouse native metrics are not available in federal environments**

    To learn more, read <a href="/docs/home/infrastructure/federal">LaunchDarkly in federal environments</a>.
  </Danger>
</View>

<View title="EU docs" />

This topic explains how to analyze LaunchDarkly experiments using exposure data from an external data warehouse.

Assignment data records which contexts were exposed to which experiment variation. By default, LaunchDarkly generates this data from the flag or AgentControl config evaluations that your SDKs send. An assignment data source replaces that default with a query against your own warehouse. This lets you measure experiments where assignment happens outside LaunchDarkly. For example, you can analyze an experiment that an email platform, a marketing tool, or an internal data pipeline assigned.

Experiments that use an assignment data source do not use a flag or config. Instead, you select an assignment data source and the experiment you want to analyze from within that source.

A single assignment data source can contain assignments for many experiments, and you can reuse it across multiple experiments in the same project and environment.

## Prerequisites

To create an assignment data source, you need:

* An existing warehouse native Experimentation integration. To learn more, read [Setting up external warehouses](/docs/home/warehouse-native/warehouses).
* A table or view in your warehouse containing the assignment data you want to analyze with the columns described in [Assignment data requirements](#assignment-data-requirements).
* A role with the `createAssignmentDataSource` action. To learn more, read [Assignment data source actions](/docs/home/account/roles/role-actions#assignment-data-source-actions).

Experiments that use an assignment data source have the following constraints:

* They must use [warehouse native metrics](/docs/home/warehouse-native/metrics).
* They do not use a flag config, which means they can't use targeting rules.
* They can use only one assignment data source each.
* They cannot use [holdouts](/docs/home/holdouts) or [layers](/docs/home/experimentation/mutually-exclusive).
* You must create the assignment data source before you build the experiment.

### Warehouse access

When you set up your warehouse native Experimentation integration, you grant LaunchDarkly read access to the database and schema that contain your metric events.

If LaunchDarkly cannot read your assignment data, an error appears when you preview your query, along with the SQL statements that grant the access LaunchDarkly needs. Run those statements in your warehouse, then preview your query again.

## Assignment data requirements

Each row your query returns represents one context's exposure to one experiment variation. Your query must return a column for each of the following fields:

<table>
  <thead>
    <tr>
      <th>Field</th>
      <th>Description</th>
      <th>Example column values</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>Experiment ID</td>
      <td>The experiment the assignment belongs to. You choose which experiment to analyze when you build the experiment in LaunchDarkly.</td>
      <td><code>homepage\_banner\_test</code>, <code>onboarding\_email\_test</code></td>
    </tr>

    <tr>
      <td>Variant ID</td>
      <td>The variation the context received. These values become the variants you compare in your experiment results.</td>
      <td><code>control</code>, <code>treatment</code></td>
    </tr>

    <tr>
      <td>Context kind</td>
      <td>A column of unique identifiers, which you map to one of the context kinds defined in your LaunchDarkly project. You can map more than one identifier and context kind pair.</td>
      <td><code>user\_id</code> mapped to the <code>user</code> context kind</td>
    </tr>

    <tr>
      <td>Timestamp</td>
      <td>When the exposure occurred.</td>
      <td><code>2026-04-02 09:14:22</code></td>
    </tr>
  </tbody>
</table>

Choose a timestamp column that uses the timestamp or datetime format and encodes timezone information. LaunchDarkly uses the exposure timestamp to determine which metric events to attribute to each context. An ambiguous timezone can cause LaunchDarkly to attribute events incorrectly.

## Use and manage assignment data sources

To learn how to create and use assignment data sources, read [Creating and managing assignment data sources](/docs/home/warehouse-native/manage-assignment-data-sources).
