In a config modifier schema, use if to define a conditional state to run a given action or not.
A conditional allows you to determine how to construct an output value by conditionally executing different keywords, based on the evaluation of a set of values.
You can use one of these sub-keywords to construct a conditional statement:
- operator
- terms
- then
- else
This keyword executes at the following nesting level:
- omit
- constant
- references
- use
- get
- properties or if or concat or switch or pipe or merge
- default
- plugin
Determines what action to take based on one of the following operators. The config modifier defines what should happen if a value exists and meets the criteria of any of these operators.
Defines a sequential array of keywords to execute on. All terms are evaluated in sequence, then the related operator performs the appropriate action. You can review the requirements for terms based on the operator used.
These keywords are used in conjunction with each other to define which action should happen when:
- Execute the then action when the operator resolves to a true state.
- Execute the else action when the operator resolves to a false state.
For example, you could define which fields to use to build an object.
During processing, the request checks if the procedure code equals 523 in the initial payload. If so, the then action executes, meaning that the procedure code is set to 691. If the procedure code doesn’t equal 523, the else action executes, meaning that the original procedure code is passed.