In a config modifier schema, use this keyword to specify that a certain value should always be returned in the processed payload. The value can be a primitive value or an object.
A constant keyword ends the processing of a schema. Any other keywords at the same nesting level or below it are skipped.
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
You could define which value to return at a given selector based on certain conditions.
Example: Constant input from initial payload
json
Example: Constant selector
json
Example: Config modifier with constant keyword
yaml
During processing, the request checks if MSH.6.1 equals ZA310 in the initial payload. If so, the then action executes, meaning that MSH.4.1 is set to GDXIP. If MSH.6.1 doesn’t equal ZA310 , the else action executes, meaning that MSH.4.1 is set to GDXAMB.
Example: Constant output
json