Setyenv · Docs
  • English
  • Español
  • 中文
  • 日本語
  • العربية
  • Deutsch
  • Français
  • हिन्दी
  • Bahasa Indonesia
  • Italiano
  • Nederlands
  • Português
  • Русский
  • Türkçe

Conditional visibility

Show or hide a field based on the value of other fields.

Where

In the form designer, select a field → inspector right side → Visibility section → Show this field when… dropdown.

How

Two ways to author the predicate:

  1. Visual builder (default). For each rule you pick a field + operator + value. Rules combine with AND or OR. Handles the 99% case.
  2. JSON-Logic mode. For the 1% complex case, write the predicate as a JSON-Logic expression. Example: {"and": [{"==": [{"var": "status"}, "Churned"]}, {"!=": [{"var": "account_manager"}, null]}]}.

Re-evaluation

The predicate is evaluated client-side on every field change AND server-side at save time. So:

  • The field hides/shows live as the user types.
  • Even if a user tampers with the form HTML to fill a hidden field, the server-side check rejects the save.

Common patterns

  • Status-dependent fields: hide "Churned reason" unless Status = Churned.
  • Optional contact methods: show the "Phone number" field only when "Preferred contact: phone" is selected.
  • Role-dependent fields: hide a sensitive field unless the user has a specific WP role. Conditional visibility supports a current_user.role variable.