---
name: app-configuration-ac-feature-flags
title: Targeting feature flags to segments
description: As an app owner, create, and manage feature flags, add them to collections and use them in your app by using SDKs. You can also control the applicability of a feature by enabling or disabling it at run time.
last-updated: 2026-06-25
---

> ## Documentation Index
> The table of contents for this documentation set is at https://cloud.ibm.com/docs/app-configuration?format=markdown
> The index for all IBM Cloud docs is at: https://cloud.ibm.com/docs/llms.txt
> Use these files to discover more information as needed.

# Targeting feature flags to segments
{: #ac-feature-flags}

As an app owner, create, and manage feature flags, add them to collections and use them in your app by using SDKs. You can also control the applicability of a feature by enabling or disabling it at run time.
{: shortdesc}

You can add an approval process flow for any configuration changes initiated through an App Configuration environment by using the ServiceNow integration. The approval process flow is applicable to an App Configuration environment like dev, stage, and production. For more information, see [Manage workflow](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-manage-workflow&format=markdown).

A feature can be enabled or disabled to all the collection users or to a specific set of users and devices or to a certain percentage of specific set of users and devices.

Enabling or disabling features can be coordinated by defining a start and end time and date. Also, choose a specific day on which a defined feature can be enabled or disabled. See [Scheduled Flags](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-scheduled-flags&format=markdown) for more information on how to set start and end time, date and choosing a specific day for toggling of your feature flag.

By default, the **Feature flags** page displays the list of feature flags that are created in the current environment of the App Configuration service instance along with details of the record like **Name**, **Type**, **Last Updated**, **Last Evaluated**, **Segments** that are targeted. Flag types are categorized as Boolean, Numeric, or String.

- A **Boolean** flag has two values and you can set the default value as 'true' or 'false'.
- A **String** type flag supports data in the form of text, and JSON or YAML files.
- A **Numeric** flag supports integers.

![List of feature flags](images/ac-list-feature-flag.png "List of feature flags"){: caption="List of feature flags" caption-side="bottom"}

## Create a feature flag
{: #ac-create-feature-flag}

To create a feature flag, complete these steps:

1. In the App Configuration console, click **Features flags**.

1. Select the **Current Environment** to display the list of feature flags in that environment.

1. Click **Create**. The side panel opens with fields for creating a new feature flag.

   ![Create feature flag](images/ac-create-feature-flag.png "Creating feature flag"){: caption="Creating a new feature flag" caption-side="bottom"}

1. Provide the feature flag details:
   - **Name** - name of the feature flag.
   - **Feature flag ID** - the feature flag ID value is auto suggested based on the entered feature name. You can modify the same, if needed. Use the **Feature flag ID** value as the identifier in your SDK or API code.
   - **Flag type** - specify the type of the feature flag. Supported type includes: Boolean, String, and Numeric. For more information about flag type and default values, see [Selecting feature flag type](#selecting-feature-flag-type).
   - **Default value** - specify the default value for the feature flag type selected. For more information about flag type and default values, see [Selecting feature flag type](#selecting-feature-flag-type).
   - Optionally, select a collection for applying a feature flag now. Otherwise, you need to add a collection before you toggle a feature flag. You can add the feature flag to one or more collections by selecting in the **Flag availability across collections** list.
   - **Feature rollout** - specify the `Rollout percentage` by using the slider. For more information about manual rollout, see [Configure feature rollout percentage](#configure-rollout-percentage).
   - **Description** - add a description of the feature flag, which is optional.
   - Optionally, define **Tags** that help you to identify the feature flag.

1. Click **Create**.

By default, when you create a new feature flag, the **Enabled** toggle switch is set to `OFF`.
{: note}

## Selecting feature flag type
{: #selecting-feature-flag-type}

You can have one of the following flag types that is associated to a feature flag:
- Boolean
- String
- Numeric

Each of the Flag type is having a default value.
{: #flag-type-default-value}

- When you set the toggle switch to *ON*, the value for the **Enabled value** is required, which can be overridden when targeting to a segment.
- When you set the toggle switch to *OFF*, the value for the **Disabled value** is required, which can be overridden when targeting to a segment.

### Boolean
{: #feature-flag-type-boolean}

When you select the **Flag type** as *Boolean*, the **Default value** details are displayed:

![Feature flag type - Boolean](images/ac-feature-flag-boolean.png "Selecting feature flag type as Boolean"){: caption="Feature flag type - Boolean" caption-side="bottom"}

1. Select the **Enabled value** from the list. This value is returned by default when the toggle switch is set to *ON* for the feature flag. This value can be overridden when targeting to a segment.

1. Select the **Disabled value** from the list. This value is returned by default when toggle switch is set to *OFF* for the feature flag.

### String
{: #feature-flag-type-string}

When you select the **Flag type** as *String*, the **Default value** details are displayed:

![Feature flag type - String](images/ac-feature-flag-string.png "Selecting feature flag type as string"){: caption="Feature flag type - String" caption-side="bottom"}

1. Select the **Format** of the string flag type from the list. Supported format is Text, JSON, and YAML. When JSON or YAML format is selected, provide the **Enabled value** and **Disabled value** in the selected format.

1. Specify the **Enabled value**. This value is returned by default when toggle switch is set to *ON* for the feature flag. This value can be overridden when targeting to a segment.

1. Specify the **Disabled value**. This value is returned by default when toggle switch is set to *OFF* for the feature flag.

### Numeric
{: #feature-flag-type-numeric}

When you select the **Flag type** as *Numeric*, the **Default value** details are displayed:

![Feature flag type - Numeric](images/ac-feature-flag-numeric.png "Selecting feature flag type as numeric"){: caption="Feature flag type - Numeric" caption-side="bottom"}

1. Select the **Enabled value** from the list. Only integer values are supported. This value is returned by default when toggle switch is set to *ON* for the feature flag. This value can be overridden when targeting to a segment.

1. Select the **Disabled value** from the list. Only integer values are supported. This value is returned by default when toggle switch is set to *OFF* for the feature flag.

## Target collections to feature flags
{: #collection-target-feature-flags}

Optionally, select a collection for applying a feature flag now. Otherwise, you need to add a collection before you toggle a feature flag.
You can add feature flags to one or more collections either during creation of feature flag or during editing feature flag details.

For adding collections to the feature flag, for the **Flag availability across collections** field, select the collection from the list.

If you try to target a feature flag that is not linked to a collection, a window is displayed to add a feature flag to a collection.
{: note}

## Configure feature rollout percentage
{: #configure-rollout-percentage}

You can configure the feature flag with a rollout percentage in the range of 0 to 100, denoting the applicability of the feature to a partial set of users or devices.

Manual rollout helps to enable a feature to a small percentage of random users or subset of entities, providing more control on the release cycle and achieve progressive delivery. When you are confident on the feature that you want to roll out is working as intended, increase the percentage over time.

Manual rollout uses a hashing algorithm that generates a hash based on the rule set. This hash is used by the SDK to generate a percentage value for that user. The percentage value generated for that user is compared to the value set for the manual rollout value, determines whether the user is eligible to receive that feature or not.

For example, the hash has partitions from 1 to 100,000. When you assign a feature flag, the hash assigns values from 1 to 100,000 to users in each partition. For example, when you assign 25% to a feature flag, App Configuration SDK delivers that feature to hash partitions from 1 to 25,000. If you change the percentage of users receiving that feature from 25% to 50%, partitions 25,001 to 50,000 would be added to the set of partitions already receiving that feature.

Manual rollout capability is available for Lite and Enterprise plans.
{: note}

Following are some of the manual rollout scenarios:

- If the feature flag is disabled, then SDK returns the default **Disabled value**.
- If the feature flag is enabled without any segment rules and no manual rollout is set, then the SDK returns default **Enabled value**.
- If the feature flag is enabled without any segment rule and manual rollout is set to 0%, then the SDK returns **Disabled value** for all users.
- If the feature flag is enabled without any segment rule and manual rollout is set to a percent, say 50%, then the SDK checks if the user belongs to the configured manual rollout size, if the user belongs to the rollout criteria, then the SDK returns the **Enabled value**. If the user doesn't belong to the rollout criteria, then the SDK returns the **Disabled value**.
- If the feature flag is enabled with segment rules, then SDK first evaluates the user against the configured rules. If user is part of the configured rule, then the SDK evaluates if the user is eligible for manual rollout.
   - If multiple rules are configured and the user is checked for rule match until the first match. If no match found, then the SDK evaluates against the default rollout.
   - If the user is evaluated to be part of the segment and the segment manual rollout is 0%, then even if the user is part of the segment, user will not receive the segment value. The SDK returns the default **Disabled value**.
   - If the user is evaluated to be part of the segment and the segment manual rollout is set to a percentage, say 50%, then the SDK checks if the user belongs to configured rollout size, if the user belongs to the rollout criteria, then the SDK returns the segment overriding value. If the user doesn't belongs to the rollout criteria, then the SDK returns **Disabled value**.

| Feature Flag | Is targeting configured? | Manual  \n rollout | Is user  \n part of  \n configured segment | Is user  \n part of  \n manual rollout \n criteria | Value  \n returned  \n by SDK |
| :---------- | :---------- | :---------- | :---------- | :---------- | :---------- |
| Disabled | NA | Any % rollout set | NA | NA | Disabled value |
| Enabled  | No | 0% | NA | No | Disabled value |
| Enabled  | Yes | 0% | Yes | No | Disabled value |
| Enabled  | Yes | 0% | No | No | Disabled value |
| Enabled  | No | Between 0% to 100% | NA | Yes | Enabled value |
| Enabled  | No | Between 0% to 100% | NA | No | Disabled value |
| Enabled  | Yes | Betweeen 0% to 100% | Yes | Yes | Overriden value |
| Enabled  | Yes | Betweeen 0% to 100% | Yes | No | Disabled value |
| Enabled  | Yes | Between 0% to 100% | No | Yes | Enabled value |
| Enabled  | Yes | Between 0% to 100% | No | No | Disabled value |
| Enabled  | No | 100% | NA | Yes | Enabled value |
| Enabled  | Yes | 100% | Yes | Yes | Overriden value |
| Enabled  | Yes | 100% | No | Yes | Enabled value |
{: caption="Percentage rollout scenarios" caption-side="bottom"}

## Targeting a segment with a feature flag
{: #targeting-segment-with-feature-flag}

You can roll out feature flags to one or more target segments. You can set different flag values for different segments, if needed.

1. From the App Configuration console, go to **Feature flags**. This pane displays the list of feature flags available in the current environment of the App Configuration service instance.

1. Click **Add targeting** in the required feature flag row to display the **Add targeting configurations** side-panel.

1. The **Feature rollout (Default)** section displays the default **Rollout percentage** slider defined when creating the feature flag. You can adjust the rollout percentage value by moving the slider. Changes are saved automatically as you adjust the slider.

1. In the **Rules** section, you can define rules that control who sees your feature, and manage multiple rules with ease. The initial view shows the **Create Rule** button and a search field to filter existing rules.

   ![Adding a Rule](images/ac-targeting-configurations-panel.png "Adding a rule"){: caption="Adding a rule" caption-side="bottom"}

   When creating the rule specify the following:

   - **Rule Name** - Enter a descriptive name for the rule (maximum 100 characters).
   - **Rule ID** - Enter a unique identifier for the rule. This must contain only letters, numbers, dots (.), hyphens (-), and underscores (_). Maximum 100 characters.
   - In the **Rollout percentage**, you can define the value as **Override** or **Inherit from default**. If the **Override** option is selected, adjust the **Rollout percentage** value by using the slider. The percentage is saved automatically as you adjust the slider.
   - **Select segments** - Choose one or more segments from the list. The selected segments are displayed with a count indicator (e.g., "1 × segment is selected"). If no segments are available to target, click **Create segment**. For more information about creating a segment, see [Create a segment](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-segments&format=markdown#ac-create-segment).
   - For the **Enabled value**, you can select **Override** and modify the value or select **Inherit from flag**.
   - **Priority** - Set the rule priority to determine the order in which rules are evaluated. You can set the priority to one of the following options:

      - Set to Bottom - Sets the priority of the rule to last. This is the default option.
      - Set to Top - Sets the priority to the top of the rules (i.e. 1).
      - Specific Position - Sets the priority to specific user defined position. (Priority number can be between 1 to number of rules).

   The rule is created and saved when you click **Save Rule**. There is no separate **Create** or **Cancel** button - simply close the panel when you're done configuring the rule.
   {: note}

1. After creating a rule, it appears in the rules table showing **Priority**, **Rule Name**, **Segments**, and **Rollout** information. You can perform the following actions for each rule by using the overflow menu :

   - **Copy** - Create a new rule by duplicating an existing rule.

   ![Copy Rule overflow menu](images/ac-copy-rule-overflow-menu.png "Copy Rule overflow menu"){: caption="Copy Rule overflow menu" caption-side="bottom"}

   ![Copy rule view](images/ac-copy-rule-view.png "Copy rule view"){: caption="Copy rule view" caption-side="bottom"}

   - **Edit rule** - Modifies an existing rule configuration.

   ![Edit rule overflow menu](images/ac-edit-rule-overflow-menu.png "Edit rule overflow menu"){: caption="Edit rule overflow menu" caption-side="bottom"}

   ![Edit rule view](images/ac-edit-rule-view.png "Edit rule view"){: caption="Edit rule view" caption-side="bottom"}

   - **Edit priority** - Change the rule evaluation order. Priority determines the order in which rules are evaluated. Rules with a lower priority number are evaluated first. You can set the priority to one of the options mentioned previously.

    ![Edit priority overflow menu](images/ac-edit-priority-overflow-menu.png "Edit priority overflow menu"){: caption="Edit priority overflow menu" caption-side="bottom"}

    ![Edit priority rule view](images/ac-edit-priority-rule-view.png "Edit priority rule view"){: caption="Edit priority rule view" caption-side="bottom"}

   - **Delete** - Remove the rule. When you select delete, a confirmation dialog appears to prevent accidental deletion.

   ![Delete rule overflow menu](images/ac-delete-rule-overflow-menu.png "Delete rule overflow menu"){: caption="Delete rule overflow menu" caption-side="bottom"}

   ![Delete confirmation dialog](images/ac-delete-confirmation.png "Delete confirmation"){: caption="Delete rule confirmation dialog" caption-side="bottom"}

If you try to target a feature flag that is not linked to a collection, a window is displayed to add a feature flag to a collection.
{: note}

## How targeting rules are evaluated
{: #feature-flag-targeting-rule-evaluation}

When you configure targeting, keep the following evaluation behavior in mind:

- Within a segment, different attributes are evaluated with `AND`.
- Within a single segment attribute, multiple values are evaluated with `OR`.
- Within a targeting rule, multiple selected segments are evaluated with `OR`.
- Across targeting rules, rules are evaluated by priority, and the first matching rule is applied.

For example, if a rule contains the segments `Production - US-East` and `Production - Eu-De`, the rule matches when either segment matches. If you want to roll out to those audiences separately, create separate rules or define each segment with all required attributes and order the rules by priority.

If you want to enable a feature first for production users in `eu-de`, and later for production users in `us-east`, define each segment with all required attributes, such as:

- Segment 1: `environment is production` and `region is eu-de`
- Segment 2: `environment is production` and `region is us-east`

Then target those segments in separate rules and order the rules by priority in the **Edit targeting** view. This approach helps ensure that each rule matches only the intended audience.




## Enabling a feature flag
{: #enabling-feature-flag}

After you target a feature flag to a segment, click the toggle (ON/OFF) to enable or disable a feature flag.



## Feature flags - overflow menu
{: #feature-flags-overflow-menu}

The overflow menu for each of the feature flag (three vertical dots) consists of **Edit**, **Copy**, and **Delete** operations and **Remove targeting** for those feature flags that are already targeted.

![Overflow menu for a feature flag](images/ac-feature-flag-overflow-menu.png "Overflow menu for a feature flag"){: caption="Overflow menu for a feature flag" caption-side="bottom"}

- When **Edit** option is selected, you can change the **Name**, **Description**, add or delete **Tags**, change the **Flag type** and **Default value**, and add or remove collections for the **Flag availability across collections** field information.
- When **Copy** option is selected, the feature flag information is copied, and you need to modify the **Name** of the feature flag. Optionally, modify the other details based on your need.
- When **Delete** option is selected, a confirmation window is displayed to seek confirmation to delete the selected feature flag. Deleting option permanently deletes the feature flag and the action cannot be undone.
- In the list of feature flags, in a feature flag, when **Copy to clipboard** icon is clicked, the feature flag's **Feature flag ID** value is copied to the clipboard.
- **Remove targeting** removes the targeting of feature flags to a segment.