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

Managing segments

Read time: 3 minutes
Last edited: Nov 19, 2024

Overview

This topic explains how to edit and delete segments. You can update a segment's details, update its targeting, and target segments within flags.

Update segment details

To update a segment's details:

  1. Navigate to the segment detail page for the segment you want to update.
  2. Click the gear icon to open the segment's settings page.
  3. Edit the Name, Description, and Tags for each segment.
  4. Click Save.

Update segment targeting

To update a segment's targeting:

  1. Navigate to the segment detail page for the segment you want to update.
  2. Update the segment's targeting based on the kind of segment:
  • For rule-based segments, add, remove, or edit the segment's targeting rules. To learn more, read Rule-based segments.
  • For list-based segments, add or remove individual targets or upload a new CSV to overwrite or merge with the existing targets. To learn more, read List-based segments.
  • For synced segments, you cannot change segment targeting within LaunchDarkly. Instead, edit the segment in the source application. To learn more, read Segments synced from external tools.

Test segment targeting

You can test a segment's targeting rules to find out whether or not a particular context will be included in the segment. Testing segment targeting helps ensure that contexts are included or excluded from segments as you expect.

To test a segment's targeting:

  1. From the Segments list, open the segment you want to test.

  2. Make any needed changes to the segment rules and save your changes.

  3. Click the fingerprint icon. The "Test run a context" section appears.

  4. In the contexts field, search for and select the context you want to preview.

    The "Test run a context" section, populated with an example context kind and key.
    The "Test run a context" section, populated with an example context kind and key.

The "Test run a context" section populates with whether or not the context is included in the segment.

Target segments in flags

To target the segment in a flag:

  1. Navigate to the segment detail page for the segment you want to update.
  2. Click the > icon to expand the "N flags targeting this segment" callout. "N" is the number of flags currently targeting this segment.
  3. Click Target this segment.
  4. In the "Target this segment with a flag rule" dialog, select the flag where you want to use the segment. Then click Target this segment.

Alternatively, you can navigate to the Flags list and add a new targeting rule directly from the flag's Targeting tab.

Delete segments

To delete a segment:

  1. Navigate to the segment detail page for the segment you want to update.
  2. Click the gear icon to open the segment's settings page.
  3. Click Delete this segment.
  4. In the "Delete segment?" dialog, click Delete.

You cannot delete a segment if one or more flags is using it.

You can also use the REST API: Delete segment