Skip to main content

Variations

Overview

A Variation is a potential value for a Feature Flag.

When you retrieve Feature Flags from an AppFlags SDK, each Feature Flag will resolve to one of the Variations based on the Feature Flag's Targeting Rules. Variations are shared across all Environments.

info

For an overview on modifying Variations, also see the Getting Started guide on Modifying Variations.

Variation Types

When you create a Feature Flag, you set the Variation type. This determines the data type of the Variation values.

The Variation types are boolean, number, and string.

  • A boolean flag always has two Variations: true and false.
  • A number or string flag can have any number of Variations.
tip

You can store JSON and other structured data in a string Variation

Adding Variations

You can add Variations to a Feature Flag at any time.

To add a new Variation:

  • Click the "Add variation" button underneath the existing Variations. enter the new Variation, and click the "Save Changes" button.
  • Enter the information for the new Variation:
    • Value: The value for the Variation.
    • Name (optional): A human-readable name for the Variation.
    • Description (optional): A longer field where you can add details about the Variation.
      info

      Name and Description are only used in the AppFlags dashboard. Only the Value is exposed in the AppFlags SDK.

  • Click "Save Changes".

A new Variation is set to 0% active in all Environments. You can update the Targeting Rules to make the new Variation active.

Modifying Variations

You can modify a Variation at any time. If the Variation is active, the AppFlags client in your application will immediately receive the updated Variation value.

To modify one or more Variations:

  • Modify the Value, Name, or Description in the Variation's text boxes.
  • Click "Save Changes".

Removing Variations

To remove a Variation:

  • Click the red "Remove" button next to the Variation.
  • Click "Save Changes".
info

You can only remove Variations that are not active in any Environments. If a Variation is active, the "Remove" button will be gray and disabled.