Override selected fields in JSON flag values
You can change selected fields in a JSON flag rule without copying the flag's entire default object. The rule stores only the keys you override, and GrowthBook fills in the unchanged top-level fields from the default. On a large configuration flag, each rule then holds only what it changes.
Keep the change small
For example, start with this default:
A sparse rule value needs only:
The resolved value is {"theme":"dark","pageSize":20}. The editor displays this expanded value, so you can check the combined configuration.
Each sparse value merges onto the flag's default, not onto the values of other rules. If you turn sparse mode on for an existing rule, the editor keeps only the keys that differ from the default.
Know what gets replaced
- Use a JSON flag whose default is a plain object. Arrays, null, and primitive defaults do not support sparse merging.
- Overrides replace top-level properties. If a property contains a nested object, include every nested field you need in the replacement.
- Safe Rollout rules and holdout values are outside this change. A configured JSON schema takes precedence over sparse editing.
Getting started
Open a JSON flag with an object default, edit a forced-value rule, and enable sparse mode. Enter the changed keys and inspect the expanded value before saving.