You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/advanced/predefined-variations.mdx
+9-10Lines changed: 9 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,24 @@
1
1
---
2
2
id: predefined-variations
3
-
title: PredefinedVariations
3
+
title: PredefinedVariations vs Free‑Form Values
4
4
description: Learn about free-form values and predefined variations in ConfigCat, how they differ, and when to use each approach for managing feature flag values.
5
5
---
6
6
7
7
ConfigCat supports two value-modes for feature flags: _free-form values_ and _predefined variations_. This guide explains the differences between these approaches and helps you choose the right one for your use case.
8
8
9
-
10
9
## Overview
11
10
12
11
In ConfigCat, you can configure feature flags to operate in either of these modes:
13
12
14
-
-**Free-form values** - Allows arbitrary feature flag values. You can set served values to any value.
13
+
-**Free-form values** - Allows arbitrary values for non-boolean feature flags. You can set served values of such flags to any value.
15
14
-**Predefined variations** - Constrains feature flag values to a set of variations specified beforehand. You can select served values from a dropdown.
Free-form values are the traditional, unrestrictive mode that lets you enter a feature flag's exact value each time you set it.
23
23
24
24
<p>
@@ -37,8 +37,6 @@ Free-form values are the traditional, unrestrictive mode that lets you enter a f
37
37
38
38
Free-form values work well when you have simple, one-off configurations where feature flag values are unique and unlikely to be reused. They're ideal when you need quick setup without upfront planning, especially when working with primitive values like booleans or simple strings and numbers. This approach is also suitable when values change frequently or unpredictably.
39
39
40
-
41
-
42
40
## Predefined variations
43
41
44
42
Predefined variations allow you to define a set of reusable values upfront when creating a feature flag. These variations can then be selected from a dropdown when setting up flag rules. Each variation consists of three fields:
@@ -66,24 +64,25 @@ Predefined variations allow you to define a set of reusable values upfront when
66
64
67
65
Predefined variations are ideal when you have a standard set of values used across multiple rules, especially when consistency is critical for things like color schemes, API endpoints, or configuration objects. They work well when multiple team members need to understand what each value represents and you want to prevent typos or invalid values. This approach is particularly valuable when complex values like JSON objects need to be reused, when you need to provide guidance on when to use specific values, and when values are known upfront and relatively stable.
68
66
69
-
70
67
## Converting between free-form values and predefined variations
71
68
72
69
ConfigCat provides an easy way to convert feature flags between free-form values and predefined variations.
73
70
74
71
### Converting to predefined variations
75
72
76
-
You can convert a feature flag to use predefined variations by clicking the **Convert to use variations** item in the kebab (3 dots) menu of the feature flag.
73
+
You can convert a feature flag to use predefined variations by clicking the **Convert to use variations** item in the kebab (3 dots) menu of the feature flag.
74
+
77
75
When you convert a feature flag from free-form values to predefined variations, ConfigCat automatically collects all currently used values from your existing flag rules. These collected values are presented as suggested variations, but you can modify their display names and hints, or even add new variations.
78
76
79
-
The conversion doesn't affect your deployed applications.
77
+
The conversion doesn't affect your applications deployed to production.
80
78
81
79
### Converting to free-form values
82
80
83
-
You can convert a feature flag to use free-form values by clicking the **Convert to use free-form values** item in the kebab (3 dots) menu of the feature flag.
81
+
You can convert a feature flag to use free-form values by clicking the **Convert to use free-form values** item in the kebab (3 dots) menu of the feature flag. (For boolean feature flags, the corresponding menu item is **Convert to use ON/OFF toggle**.)
82
+
84
83
When you convert a feature flag from predefined variations to free-form values, the actual values from variations are extracted and feature flag values are updated to use the values directly. Display names and hints are irreversibly deleted, leaving only the values.
85
84
86
-
The conversion doesn't affect your deployed applications.
85
+
The conversion doesn't affect your applications deployed to production.
0 commit comments