Predicates
Predicates allow you to control form behavior based on other field values. You can use them to make fields required or disabled dynamically.
This is useful when a field should only be relevant under certain conditions (e.g. when another field is set to a specific value).
Supported Fields
You can apply predicates to:
requireddisabled
Formats
✅ 1. Boolean
Use a static value (true or false):
"required": true
✅ 2. Simple Predicate
Require a field based on the value of another field:
"required": {
"key": "language",
"equals": "java"
}
✅ 3. Predicate Group
Combine multiple conditions using all or any:
"required": {
"operation": "all",
"comparators": [
{ "key": "language", "equals": "java" },
{ "key": "includeCI", "equals": true }
]
}
{
"key": "template",
"type": "select",
"label": "Service Template",
"required": {
"key": "language",
"equals": "java"
},
"dataSource": {
"url": "https://data.platformworks.co/api/github/templates?language={language}"
}
}
This makes the template field required only when the selected language is java.
Notes
- Field keys in predicates must match existing field keys in the same form.
- Predicates support:
equals,notEquals,in,notIn, andempty.