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/targeting/targeting-rule/flag-condition.mdx
+8-6Lines changed: 8 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,9 @@ For more details on the evaluation of Flag Conditions, please refer to [Feature
20
20
21
21
## How to set a Flag Condition?
22
22
23
-
You can set a Flag Condition for a feature flag on the ConfigCat Dashboard. The prerequisite flag can be any feature flag already defined in the same config on the Dashboard. In the case of settings other than feature flags (boolean settings), you can also set a comparison value to which the prerequisite flag's value will be compared.
23
+
You can set a Flag Condition for a feature flag on the ConfigCat Dashboard by clicking on the **+IF** ("Add targeting rule") button.
24
+
25
+
The prerequisite flag can be any feature flag already defined in the same config on the Dashboard. In the case of settings other than feature flags (boolean settings), you can also set a comparison value to which the prerequisite flag's value will be compared.
24
26
25
27
<imgsrc="/docs/assets/targeting/targeting-rule/flag-condition/flag-condition.png"width="700"alt="set flag condition"decoding="async"loading="lazy"/>
26
28
@@ -36,11 +38,11 @@ You can set a Flag Condition for a feature flag on the ConfigCat Dashboard. The
36
38
37
39
A Flag Condition consists of the following:
38
40
39
-
-**Prerequisite flag key**: The key of the feature flag (or setting) on which the condition is based.
41
+
-**Prerequisite flag key**: The key of the feature flag or setting on which the condition is based.
40
42
-**Comparator**: The comparison operator that defines the relation between the prerequisite flag's value and the comparison value. See the available comparators below.
41
43
-**Comparison value**: Available only when the prerequisite flag is a string, integer or double setting. The value that the prerequisite flag's value is compared to.
42
44
43
-
### Comparators
45
+
### Comparator
44
46
45
47
Different comparators are available for different types of prerequisites.
46
48
@@ -65,16 +67,16 @@ When the prerequisite is a string, integer or double setting, the following comp
65
67
#### Context
66
68
Our demo company, Whisker Co. has a mobile app, which, among other things, can show the cat-friendly cafés in the neighborhood.
67
69
68
-
The app can send notifications about the users' favorite cafés. This feature is not available to everyone though, it's enabled using the `Enable Cafe Notifications` feature flag.
69
-
There is another feature that allows users to rate cafés, whose availability is controlled similarly, via the `Enable Cafe Ratings` feature flag.
70
+
The app can send notifications about the users' favorite cafés. This feature is not available to everyone though, it's enabled using the **Enable Cafe Notifications** feature flag.
71
+
There is another feature that allows users to rate cafés, whose availability is controlled similarly, via the **Enable Cafe Ratings** feature flag.
70
72
71
73
#### Goal
72
74
We want to make sure that users only receive notifications about their favorite cafés if they can rate them.
73
75
74
76
#### Solution
75
77
ConfigCat offers a built-in way to solve this problem without the need of extra coding: prerequisite flags.
76
78
77
-
We can achieve our goal by adding a Targeting Rule containing a Flag Condition to `Enable Cafe Notifications`, then referencing `Enable Cafe Ratings` in the condition and setting the comparator to `IS ON`, meaning that the `Enable Cafe Notifications` feature flag will be enabled only if the `Enable Cafe Ratings` feature flag is ON.
79
+
We can achieve our goal by adding a Targeting Rule containing a Flag Condition to **Enable Cafe Notifications**, then referencing **Enable Cafe Ratings** in the condition and setting the comparator to **IS ON**, meaning that the **Enable Cafe Notifications** feature flag will be enabled only if the **Enable Cafe Ratings** feature flag is ON.
0 commit comments