Prerequisites
To create an assignment data source, you need:- An existing warehouse native Experimentation integration. To learn more, read Setting up external warehouses.
- A table or view in your warehouse containing the assignment data you want to analyze with the columns described in Assignment data requirements.
- A role with the
createAssignmentDataSourceaction. To learn more, read Assignment data source actions.
- They must use 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 or layers.
- 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:| Field | Description | Example column values |
|---|---|---|
| Experiment ID | The experiment the assignment belongs to. You choose which experiment to analyze when you build the experiment in LaunchDarkly. | homepage_banner_test, onboarding_email_test |
| Variant ID | The variation the context received. These values become the variants you compare in your experiment results. | control, treatment |
| Context kind | 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. | user_id mapped to the user context kind |
| Timestamp | When the exposure occurred. | 2026-04-02 09:14:22 |