App rules — show and hide fields depending on values
Updated 2026-11-13
How to make the web app show an input or a result only when another input has a certain value, with the exact rule format and its limits.
What app rules do
By default the web app shows every input and every output. An app rule ties one input or one output to a condition: the field is shown only while a chosen input has a chosen value. This keeps a form short. Example: the field "Company name" appears only when "Customer type" is "Business".
Rules react at once. When the visitor changes the value the rule depends on, fields appear or disappear without reloading.
Add rules
- Open your service and open Apps → Web App → Default App (Web-App → Standard-App).
- Click App Rules (Advanced) (App-Regeln (Erweitert)) to open the field.
- Enter the rules as JSON (see the format below).
- If something is wrong with the text, a red message below the field says what, for example
Rule 2: Missing "visible" field. - Click Save (Speichern) at the top of the service page. Try the rules in Live Preview (Live-Vorschau).
To remove all rules, empty the field and save. An empty field means the default: everything is shown.
The rule format
{
"rules": [
{
"input": "company_name",
"visible": { "input": "customer_type", "equals": "Business" }
},
{
"output": "vat_amount",
"visible": { "input": "include_vat", "equals": "true" }
}
]
}Each rule has two parts:
| Part | Meaning |
|---|---|
"input" or "output" | The name of the field the rule controls. Use exactly one of the two. |
"visible" | The condition: "input" is the name of the input to watch, "equals" is the value at which the field is shown. |
Use the names of your inputs and outputs, not their titles. You find the names in the parameter panel of the Configuration (Konfiguration) tab.
How a rule is evaluated
- A field with a rule is shown only while the watched input equals the value. In every other case it is hidden.
- A field without a rule is always shown.
- Values are compared as text and must match exactly, including upper and lower case:
"Business"is not"business". - For a yes/no input, use
"true"or"false". - For a percentage input, use the decimal value:
"0.05"for 5%. - Before the visitor changes anything, the condition is checked against the default value of the watched input.
- Write one rule per field. If a field has several rules, the first one counts.
- If a rule watches an input that does not exist, the field stays visible.
What happens to hidden fields
- A hidden input still takes part in the calculation with its default value. The calculation keeps working, and required inputs do not block the visitor.
- A hidden output is still calculated; it is only not displayed.
Give inputs you plan to hide a sensible default value.
Limits
- A condition checks one input for one value. There is no "greater than", no "and", no "or". To cover several cases, add an input with a list of allowed values that names the case (for example "Private", "Business", "Public sector") and let the rules watch it.
- A condition watches an input, not an output.
- Rules apply to the standard web app. Snippets and API calls are not affected: the API always returns every output.
- Rules change what is shown, not what a caller may know. A value that must stay private should not be an output of the service.
Related topics
- The standard web app
- Input validation — allowed values, required and defaults
- Themes
For developers and agents
Schema of the rules text:
{
"rules": [
{
"input": "<input name>",
"visible": { "input": "<input name>", "equals": "<value>" }
},
{
"output": "<output name>",
"visible": { "input": "<input name>", "equals": "<value>" }
}
]
}Checks made while you type, with their messages:
| Message | Cause |
|---|---|
Config must have a "rules" array | The top level has no rules list |
Rule N: Must have either "output" or "input" field | The rule names no field |
Rule N: Cannot have both "output" and "input" fields | The rule names two fields |
Rule N: Missing "visible" field | The rule has no condition |
| A JSON syntax message | The text is not valid JSON |
Comparison is String(currentValue) === String(equals). The rules are saved with the service and take effect after Save; publishing again is not needed.
FAQ
How do I show a field only when another field has a certain value?
Open Apps → Web App → Default App → App Rules (Advanced) and add a rule that names the field and the condition, for example {"rules":[{"input":"company_name","visible":{"input":"customer_type","equals":"Business"}}]}. Then click Save.
Can I hide a result depending on an input?
Yes. Use "output" with the output's name instead of "input", and set the condition under "visible". The result is shown only while the condition is met.
Do I use the name or the title of a field in a rule?
The name. Titles are the labels visitors see; rules need the technical name shown in the parameter panel.
What happens to a hidden input when the visitor calculates?
It is sent with its default value, so the calculation still works. Give inputs you hide a sensible default.
Can a rule check "greater than" or combine two conditions?
No. A rule checks whether one input equals one value. Add an input with a list of allowed values that names the case, and let your rules watch that input.
Do app rules also apply to snippets or the API?
No. App rules apply to the standard web app only. Snippets show all fields of their layout, and the API always returns every output.
My rule does nothing. What should I check?
Check that you clicked Save, that the names are the exact input and output names, and that the value matches exactly, including upper and lower case. For a yes/no input the value is "true" or "false".
What does "Config must have a \"rules\" array" mean?
The text must be an object with a list called rules, like {"rules": [ … ]}. Wrap your rules in that structure.
How do I remove all app rules?
Empty the App Rules (Advanced) field and click Save. The web app then shows all inputs and outputs again.
As an agent, what is the exact JSON for an app rule?
{"rules":[{"input":"<name>","visible":{"input":"<watched input>","equals":"<value>"}}]}; use "output" instead of the first "input" to control a result. Each rule needs exactly one of input or output plus visible.