onChange trigger), or automatically calculating a field's value from an expression involving other fields (onCalculate trigger).PUT .../fields), and must be made after the referenced fields already exist: rules reference fields by the fieldId generated by the API, which only exists once the field has been created.items array associates a fieldId with a rules object carrying a trigger (onChange or onCalculate) and one of the following two structures:operations (used with onChange): a list of operations, each with conditions (one or more conditions on field values) and actions (the actions applied when the conditions are met). Accepted condition operators: =, !=, >, >=, <, <=, in, not_in, is_empty, is_not_empty, contains, and not_contains. Accepted actions: show, hide, setRequired, setOptional, clearValue, and setValue.calculation (used with onCalculate): a free-form mathematical expression (expression) referencing other fields by their identifier, a target field (targetFieldId), the decimal precision of the result (precision), and whether the calculated field remains manually editable (editable).select, radio, or checkList, the stored value is always an array — even when only one option is selected. Use the in operator with an array value (for example, ["Yes"]) for these types, rather than = with a plain string.value field of a condition must be present even for unary operators such as is_empty and is_not_empty, which do not semantically use it — in those cases, send an empty string or an empty array.curl --location --request PUT '/v1/flows//phases//fields/rules' \
--header 'Content-Type: application/json' \
--data '{
"items": {
"items": [
{
"fieldId": "<trigger-field-id>",
"rules": {
"trigger": "onChange",
"active": true,
"operations": [
{
"conditions": [
{
"fieldId": "<trigger-field-id>",
"operator": "=",
"value": "Yes"
}
],
"actions": [
{
"type": "show",
"targetFieldId": "<target-field-id>"
},
{
"type": "setRequired",
"targetFieldId": "<target-field-id>"
}
]
},
{
"conditions": [
{
"fieldId": "<trigger-field-id>",
"operator": "=",
"value": "No"
}
],
"actions": [
{
"type": "hide",
"targetFieldId": "<target-field-id>"
},
{
"type": "setOptional",
"targetFieldId": "<target-field-id>"
},
{
"type": "clearValue",
"targetFieldId": "<target-field-id>"
}
]
}
]
}
}
]
}
}'{
"items": [
{
"fieldId": "string",
"rules": {}
}
]
}