Change the variations of your flags
When you create a Feature Flag, it has default Variations that are served when the Flag is toggled ON
or OFF
. You can accept these default Variations or you can change them.
For example:
- A Boolean Flag could have
false
set as its defaultOFF
Variation andtrue
set as its defaultON
Variation. You could change theON
Variation tofeature_enabled
and theOFF
Variation tofeature_disabled
. - A Multivariate Flag could have
Variation_1
set as its defaultOFF
variation andVariation_2
set as its defaultON
variation, withVariation_3
configured to be served only when a user has a certain email address.
You can edit the Variations of your Flags on the Harness Platform even after using the Harness Feature Flag SDKs in your application.This topic describes how to edit the default Variations of your Feature Flag and how to edit the Variations that are served for your current Environment.
Edit the default Flag Variations
When you change the default Variation of a Flag, the change is applied to only the current Environment you are in and any new Environments you create. To change the Variations in other pre-existing Environments, follow the steps in Option 1: Edit the Variations for a Specific Environment.
Go to the Feature Flag you want to edit the Variations for.
In Variations, click the edit icon.
In Edit Variations, you can add or delete a Variation and also edit the following:
Name: The name of the Variation, for example
Enabled
. The identifier is not changed if you change the name.Value: The value of the Variation, for example
Feature_Enabled
.Description: An optional description for the Variation.
Default rules for the flag: The rules that are served by default for this Flag, for example, when the Flag is enabled, serve the
Enabled
Variation.
Edit the Variations served for your current Environment
Go to the Feature Flag you want to edit the Variations for.
In the Targeting tab, under When the Default Flag is Enabled and When the Default Flag is Disabled, select the Variations you want to set as the default.
noteFor information about Specific Targeting, go to Targeting Users with Flags
Click Save to save your changes.