Field conditions

Field conditions allow you to show or hide fields based on the value of another field. This is useful when you want to show a field only when a specific value is selected or provided.

Show or hide fields

To show or hide a field, you need to add the when property to the field.

{
  "title": "Show or hide field",
  "name": "showOrHideField",
  "type": "string",
  "when": {
    "fieldRef": "title",
    "operator": "contains",
    "value": "<the value to validate>",
    "caseSensitive": false
  }
}
PropertyDescription
fieldRefThe name of the field to validate
operatorThe operator to use to validate the field value. See Supported operators
valueThe value to validate
caseSensitiveIf the validation should be case sensitive. Default: true

Supported operators

TypeValue
Equalseq
Not equalsneq
Containscontains
Not containsnotContains
Starts withstartsWith
Ends withendsWith
Greater thangt
Greater than or equalgte
Less thanlt
Less than or equallte

Feedback/comments

Last updated on

Did you spot an issue in our documentation, or want to contribute? Edit this page on Github!

Ready to get started?

Special thanks to our backers & sponsors

run.events - Event Management PlatformNetlifyBEJS CommunityStruyf Consulting
Contributors
Dennis ZomaPatrick Kollitschmayumihara