Several of our endpoints support providing logic around field data to determine if the field will show up on the form or if the action will be performed after the form is submitted. All endpoints that support field logic will accept or return a logic
property. The data passed in the logic
property must follow the below format.
{
...
"logic": {
"action": "show",
"conditional": "any",
"checks": [
{
"condition": "equals",
"field": "<Field ID>",
"option": "<Option Value>"
}
]
}
...
}
The action
property accepts two values: show
or hide
. With the show
value, Formstack will show the field when the logic is true. With the hide
value, Formstack will hide the field when the logic is true.
The conditional
property accepts two values: any
or all
. With the any
value, the logic will return true as long as any of the checks pass. With the all
value, the logic will return true only when all of the checks pass.
The condition
property accepts four values: equals
, notequals
, greaterthan
, or lessthan
.