cs-icon.svg

About Field Visibility Rules

You can use field visibility rules to dynamically show or hide specific fields on the entry page based on the values entered in certain fields. This ensures a clean and efficient data entry process, displaying only the relevant fields and improving data accuracy.

Features

  • Dynamic Behavior: Rules act as conditions that determine whether certain fields appear or disappear as users fill out an entry.
  • Custom Configuration: While creating or editing content types, you can set these rules to tailor the entry to specific data requirements.
  • Enhanced User Experience: This feature is widely used in online forms and shopping sites to streamline the entry process, ensuring users see only what’s necessary.

Field Visibility Rules for Global Fields

Field Visibility Rules can also be applied to Global fields, enabling you to control the visibility of fields inside a reusable global component.

When a Global Field with visibility rules is referenced inside a Content Type:

  • The rules are inherited into the Content Type.
  • Inherited rules are read-only at the Content Type level and can only be modified in the Global Field editor.
  • Any new rules added at the Content Type level remain editable there.

Use Cases

Field Visibility Rules are commonly used in forms to create a streamlined experience. Here are some examples:

  • E-commerce Checkout: Selecting the Same as Shipping Address checkbox hides the Billing Address field.
  • Gender-based Fields: Choosing Male for Gender can automatically add “Mr.“ before the First Name and hides female-specific titles such as “Ms.” and “Mrs.”
  • Job Application Forms: Selecting Have any prior experience? displays the Years of Experience field, while deselecting it hides the field.
  • Global Field Example: A Newsletter Preferences global field contains fields for subscription status, email address, and preferred frequency. A rule can hide the email and frequency fields unless the subscription status is set to "Subscribed."

Tip: Remember to create an entry to see the rule in action.

Note: Only the stack owners, admins, and users assigned to the developer role can create Field Visibility Rules in the stack. Refer to the Add a Field Visibility Rule document for detailed steps.

This feature improves form usability and helps ensure accurate data collection. By configuring visibility rules, you can tailor forms to meet specific content requirements.

Was this article helpful?
^