Conditional Display and Validation
Any custom field can be gated on the value of another field in the same intake form by adding a display_condition rule. The Privacy Center evaluates the rule against the values the data subject has entered so far and only renders the dependent field when the rule resolves to true.
display_condition accepts either a single rule that compares one field, or a combined rule that joins multiple rules together with a logical operator.
"reason_details": {
"label": "Tell us more",
"field_type": "textarea",
"required": false,
"display_condition": {
"field_address": "reasons",
"operator": "list_contains",
"value": "Other"
}
}A combined rule joins multiple single rules with and or or:
"california_resident_proof": {
"label": "Proof of California residency",
"field_type": "file",
"required": true,
"display_condition": {
"logical_operator": "and",
"conditions": [
{ "field_address": "state", "operator": "eq", "value": "California" },
{ "field_address": "marketing_opt_out", "operator": "eq", "value": true }
]
}
}Rule shape
A single rule has three attributes:
| Attribute | Description |
|---|---|
field_address | Key of another field declared in the same custom_privacy_request_fields object. Referencing an unknown key is rejected. |
operator | One of the supported operators below. |
value | Value compared against the referenced field. Required for every operator except exists and not_exists, which must be supplied without a value. |
A combined rule has two attributes:
| Attribute | Description |
|---|---|
logical_operator | Either and or or. |
conditions | A non-empty list of single rules or nested combined rules. |
Supported operators
The set of operators allowed inside display_condition is a deliberate subset of the broader Fides condition operators:
| Operator | Meaning | Requires a value? |
|---|---|---|
eq | Referenced field equals value. | Yes |
neq | Referenced field does not equal value. | Yes |
exists | Referenced field has been filled in (non-null). | No |
not_exists | Referenced field has not been filled in. | No |
list_contains | The referenced multi-value field contains value, or value (when a list) intersects the referenced field. | Yes |
Operator and value compatibility
The operator and the shape of value must be compatible with the field_type of the referenced field. The matrix below summarizes the permitted combinations; any other combination is rejected when the Privacy Center configuration is saved.
Referenced field_type | Allowed operators | value shape |
|---|---|---|
text, textarea, select, location | eq, neq, exists, not_exists | String |
checkbox | eq, neq, exists | Boolean (true / false) |
checkbox_group, multiselect | list_contains, exists, not_exists | String, or a list of strings |
file | exists, not_exists | — |
display_condition rules are validated at configuration save time. Misconfigured rules — unknown field_address, an operator that is not allowed for the referenced field_type, a value whose type does not match the target, or a value supplied with exists/not_exists — are rejected with 422 Unprocessable Entity so that broken rules cannot reach the rendered intake form.