constant

Last updated: Feb 19, 2026
IMPLEMENTATION
DEVELOPER
HEALTH TECH VENDOR

Definition

In a config modifier schema, use constant 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 for that specific field. Any other keywords at the same nesting level or below it are skipped.

Order of execution

This keyword executes in the following order:

  1. omit
  2. constant
  3. references
  4. use
  5. get
  6. Mutually exclusive keywords at this level:
    • properties
    • if
    • concat
    • switch
    • pipe
    • merge
    • prefer
    • items
  7. default
  8. plugin

Example

You could define which value to return at a given selector based on certain conditions.

Example: Constant input from initial payload
json
1
{
2
"MSH": {
3
"1": "|",
4
"10": 68625012079,
5
"12": {
6
"1": "2.3"
7
},
8
"2": "^~\\&",
9
"3": {
10
"1": "GENEDX"
11
},
12
"4": {
13
"1": "GDXIP"
14
},
15
"6": {
16
"1": "ZY292"
17
},
18
"7": {
19
"1": "20250428211659"
20
},
21
"9": {
22
"1": "ORU",
23
"2": "R01"
24
}
25
},
26
...
27
}
Example: Constant selector
json
1
$.MSH.4.1
Example: Config modifier with constant keyword
yaml
1
if:
2
operator: equals
3
terms:
4
- use: initialPayload
5
get: MSH.6.1
6
- constant: ZA310
7
then:
8
constant: GDXIP
9
else:
10
constant: GDXAMB

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
1
{
2
"MSH": {
3
"1": "|",
4
"10": 68625012079,
5
"12": {
6
"1": "2.3"
7
},
8
"2": "^~\\&",
9
"3": {
10
"1": "GENEDX"
11
},
12
"4": {
13
"1": "GDXAMB"
14
},
15
"6": {
16
"1": "ZY292"
17
},
18
"7": {
19
"1": "20250428211659"
20
},
21
"9": {
22
"1": "ORU",
23
"2": "R01"
24
}
25
},