In a config modifier schema, use switch to check the value of a path against possible values that need a different outcome for each case (i.e., either a constant or the value parsed from another).
Exclusive keywords
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 look at every observation code and shift the value from 0 start to 1 for certain codes. If the code matches one of the cases, then it would check the value against its own switch statement.
For instance, if Observations[0].Code was 68520-6, then we would get the Value. In the example below, the Observations array would match the second case. Because the Value is 1, it would then be mapped to 2 due to the switch statement.
Example: Switch input from initial payload
json
Example: Switch selector
json
Example: Config modifier with switch keyword
yaml
Based on this example config modifier, the Value is now 2.
Example: Switch output from processed payload
json