Forced Values, Saved Groups, and Prerequisites
Forced Values, Saved Groups, and Prerequisites
Section titled “Forced Values, Saved Groups, and Prerequisites”Sometimes you need to force a specific value for a user or group — bypassing percentage rollouts entirely. GrowthBook provides three tools for this: forced-value rules, Saved Groups, and prerequisite features.
Forced-value rules
Section titled “Forced-value rules”A Forced Value rule returns a fixed value to every user who matches the rule’s targeting condition. Useful for: internal QA testers who always get true, a VIP user who always gets a premium string value, or a banned user who always gets false.
To create a forced-value rule:
- On the Feature detail page, click Add Rule.
- Choose Force Value as the rule type.
- Set the Value to return (e.g.
true). - Add a Targeting Condition to identify the audience (e.g.
emailis in list[[email protected], [email protected]]). - Click Save Rule.
- Drag this rule above any rollout rules so it is evaluated first.
Saved Groups
Section titled “Saved Groups”A Saved Group is a reusable audience definition you create once and reference in many rules. Instead of duplicating the same email list or condition across ten different features, define it once as a Saved Group and use it anywhere.
To create and use a Saved Group:
- Go to Settings → Saved Groups.
- Click Create Saved Group.
- Name it (e.g.
beta-testers). - Add members (by attribute value) or define a condition.
- Click Save.
- When creating a rule on any Feature, choose “In Saved Group” as the operator and select
beta-testers.
On the SDK side, all you need to do is pass the correct attributes — the Saved Group logic runs server-side in GrowthBook:
gb.setAttributes({ id: 'user-456',});// GrowthBook evaluates whether this user is in the beta-testers Saved Groupconst showBeta = gb.isOn('new-checkout');gb.setAttributes({
id: 'user-456',
email: '[email protected]',
});
// GrowthBook evaluates whether this user is in the beta-testers Saved Group
const showBeta = gb.isOn('new-checkout');Prerequisite features
Section titled “Prerequisite features”A prerequisite (also called a feature dependency) lets you gate one flag on another. For example, you might require that platform-v2 is on before allowing new-checkout to activate. This prevents partial rollouts from creating inconsistent UI states.
To add a prerequisite:
- On the Feature detail page, click Add Prerequisite.
- Select the parent feature (e.g.
platform-v2). - Set the required value (e.g.
true). - Click Save. Now
new-checkoutwill only be evaluated ifplatform-v2is on for the current user.