When creating multiple entries based on a similar template, slight variations are often necessary.
For instance, consider a product page with add-ons. 90% of these add-ons might be built in-house, but the remaining 10% could come from third-party vendors, requiring editors to add specific disclaimers.
Adding an extra field (e.g., a disclaimers field) solves this, but it lengthens the content form and increases the amount of information editors must navigate, much of which may not be relevant to their task.
Our new Conditional Fields feature helps in such scenarios by simplifying the content form, displaying additional hidden fields only when specific conditions are met.
This reduces the cognitive load for editors and hence enhances their productivity.
Moreover, Hygraph is designed to free up developers and give your content teams more autonomy. Conditional Fields further enhance this autonomy, enabling editors to create content dynamically with ease.
#How to get started with Conditional Fields?
To use Conditional Fields, you must first configure the conditions in your Schema. To do so, select “edit field” for the field that you want to hide/show based on information contained in another field.
Once configured, editors will only see the additional conditional fields when the specified conditions are met.
#What’s next?
The new Conditional Fields, along with other recently released Live Preview, is part of our aim to continuously roll out a range of features designed to enhance editors' productivity.
We will continue to roll out further improvements to Conditional Fields and similar features in the future.
As always, we love hearing from you. Share your feedback on our Slack channel, and let us know what you think of the new Conditional Fields.
Frequently Asked Questions
Yes, any hidden field is removed on save once its visibility condition is no longer met.
Yes. Field visibility and read-only settings by role are available. Such fields can be hidden from editors while data is imported via API.
Yes. Conditional fields show or hide inputs, components or sections based on Boolean flags or other field values and keywords.
No. Hiding fields in the UI is not currently supported. Fields can be removed, but only after verifying the front end does not consume them. The recommended approach is to clone the environment, remove fields one by one, and regression test.
Yes. Model global settings, such as a Site Configuration, and expose only allowed fields to editors. Use conditional fields (for example, a 'show advanced fields' boolean) to allow or hide overrides. Granular GraphQL-based permissions down to model, locale and stage, plus approvals and workflows, can be enforced, and field-level editing can be restricted to admin roles.
Blog Authors