Skip to content

Commit 499b280

Browse files
committed
Revise Flag Condition (Prerequisite)
1 parent d11de7d commit 499b280

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

website/docs/targeting/targeting-rule/flag-condition.mdx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ For more details on the evaluation of Flag Conditions, please refer to [Feature
2020

2121
## How to set a Flag Condition?
2222

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.
2426

2527
<img src="/docs/assets/targeting/targeting-rule/flag-condition/flag-condition.png" width="700" alt="set flag condition" decoding="async" loading="lazy"/>
2628

@@ -36,11 +38,11 @@ You can set a Flag Condition for a feature flag on the ConfigCat Dashboard. The
3638

3739
A Flag Condition consists of the following:
3840

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.
4042
- **Comparator**: The comparison operator that defines the relation between the prerequisite flag's value and the comparison value. See the available comparators below.
4143
- **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.
4244

43-
### Comparators
45+
### Comparator
4446

4547
Different comparators are available for different types of prerequisites.
4648

@@ -65,16 +67,16 @@ When the prerequisite is a string, integer or double setting, the following comp
6567
#### Context
6668
Our demo company, Whisker Co. has a mobile app, which, among other things, can show the cat-friendly cafés in the neighborhood.
6769

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.
7072

7173
#### Goal
7274
We want to make sure that users only receive notifications about their favorite cafés if they can rate them.
7375

7476
#### Solution
7577
ConfigCat offers a built-in way to solve this problem without the need of extra coding: prerequisite flags.
7678

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.
7880

7981
On the Dashboard:
8082
![Flag Condition example](/assets/targeting/targeting-rule/flag-condition/flag-condition-example.png)

0 commit comments

Comments
 (0)