No results for ""
EXPAND ALL
  • Home
  • API docs

GIVE DOCS FEEDBACK

List-based segments

Read time: 5 minutes
Last edited: Jan 27, 2024

Overview

This topic explains how to build and manage list-based segments. List-based segments let you target individual contexts or uploaded lists of contexts.

The process for creating list-based segments varies slightly depending on how large your list is.

Smaller list-based segments

Smaller list-based segments are segments where the number of individual contexts targeted is 15,000 or fewer.

To create a new list-based segment:

  1. Navigate to the Segments list.
  2. Click Create segment. The "Create a segment" dialog appears.
The "Select a segment kind" step of the "Create a new segment" dialog
The "Select a segment kind" step of the "Create a new segment" dialog
  1. In the "Select a segment kind" step, choose List-based segments. The "Enter segment details" step appears.
  2. Give your segment a human-readable Name.
  3. Enter a Key for your segment. This field auto-populates based on the segment name, but you can change it if you like.
  4. (Optional) Add a Description.
  5. (Optional) Select or create Tags. Tags help you identify segments used by different teams or for different purposes within your organization.
  6. Under "How many individual targets will be in your list?", select "15,000 or fewer":
A portion of the "Create a segment" dialog, showing a question about the size of the list-based segment.
A portion of the "Create a segment" dialog, showing a question about the size of the list-based segment.
  1. Click Save segment. The segment's Targeting tab appears.

After you create the list-based segment, you can add the contexts:

  • To add or change the individual targets one at a time, read Targeting individual contexts.
  • To add or change the individual targets in sets of up to 1500, read Bulk editing individual contexts.

You can also add targeting rules to a smaller list-based segment. To add or change the targeting rules for your segment, read Targeting contexts with rules.

Larger list-based segments

Larger list-based segments are an Enterprise feature

Larger list-based segments are one kind of "big segment." These segments are available to customers on an Enterprise plan. To learn more, read about our pricing. To upgrade your plan, contact Sales.

Larger list-based segments are segments where the number of individual contexts targeted may be greater than 15,000. Larger list-based segments can include only one targeted context kind.

If you are working with server-side SDKs, larger list-based segments require persistent storage integration. You must configure this integration for each environment where you create larger list-based segments. To learn how, read Segment configuration for synced segments and larger list-based segments.

To create a new list-based segment:

  1. Navigate to the Segments list.
  2. Click Create segment. The "Create a segment" dialog appears.
The "Select a segment kind" step of the "Create a new segment" dialog
The "Select a segment kind" step of the "Create a new segment" dialog
  1. In the "Select a segment kind" step, choose List-based segments. The "Enter segment details" step appears.
  2. Give your segment a human-readable Name.
  3. Enter a Key for your segment. This field auto-populates based on the segment name, but you can change it if you like.
  4. (Optional) Add a Description.
  5. (Optional) Select or create Tags. Tags help you identify segments used by different teams or for different purposes within your organization.
  6. Under "How many individual targets will be in your list?", select "More than 15,000":
A portion of the "Create a segment" dialog, showing a question about the size of the list-based segment.
A portion of the "Create a segment" dialog, showing a question about the size of the list-based segment.
  1. Select the Context kind from the menu.
  2. Click Save segment. The segment's Targeting tab and the "Upload CSV" dialog appear.
  3. In the "Upload CSV" dialog, click Select file to browse for a CSV file that lists context keys for the selected context kind in its first column.
  4. Click Upload file.

The import process begins in the background. When the import completes successfully, you receive an email notification. Depending on the number of contexts in the CSV, this may take several minutes or hours.

Alternatively, you can click Cancel from the "Upload CSV" dialog and upload your CSV at a later time.

You can also use the REST API: Create big segment import

If you are on the Targeting tab of a segment that already contains contexts, you have the option to merge or overwrite the existing contexts with the contexts from the CSV file. If you are merging contexts, they must all be of the same context kind.

  • Select "Overwrite" to replace all existing contexts in the segment
  • Select "Merge" to add to the existing contexts in the segment

There are some limitations to uploading a CSV. They are:

  • The CSV file must not contain a header row. LaunchDarkly reads context keys from the first column of the CSV file.
  • LaunchDarkly does not support concurrent imports within a single environment.
  • Uploaded CSV files may not exceed 40MB in size and may not contain more than 1 million contexts. All of the contexts must be of the same context kind. If you want to add more than 1 million contexts, you can use the "Merge" option with multiple sequential file uploads.

Add and remove individual targets

After you add context targets to a list-based segment using a CSV file, you can then add or remove individual contexts.

To add or remove individual contexts to or from a larger list-based segment:

  1. Navigate to the desired segment.
  2. In the Included targets search box, enter the key of the context you want to add or remove. If the context is present in the segment, a Remove target button appears. If the user is not present in the segment, an Add target button appears.
Adding an individual context to a list-based segment.
Adding an individual context to a list-based segment.
  1. Click Add target or Remove target.
  2. Click Review and save. A "Review and save" dialog appears.
  3. Click Save changes.

Exporting segments

To export the contexts from a list-based segment into a CSV file:

  1. Navigate to the Segments list and click the name of the segment you wish to export. The segment's Targeting tab appears.
  2. Click on the "Included targets" overflow menu.
  3. Select "Export as CSV."
The overflow menu for a list-based segment with the "Export as CSV" option displayed.
The overflow menu for a list-based segment with the "Export as CSV" option displayed.

The export process runs in the background. When it completes, you receive an email notification containing a link to where you can download your CSV file.

LaunchDarkly does not support exporting segments with more than 10 million contexts.

You can also use the REST API: Create big segment export