The Variable Map Lookup Sequence
In many cases when referencing map variables in Mirth® Connect, you do not call out to a specific map, but instead use the generic lookup function:
- var value = $('variableName');
Or, you might reference a variable using Velocity Variable Replacement:
- ${variableName}
When you do this, Mirth® Connect will automatically look that key up in all available maps. That may only be the configuration/global map (in the case of the global scripts) , or it may be all maps (in the case of a filter / transformer script) . This sequence is followed:
- Response Map
- Connector Map
- Channel Map
- Source Map
- Global Channel Map
- Global Map
- Configuration Map
For example, if you have stored a variable called "dataSource" in both the Connector Map and the Global Channel Map, the one from the Connector Map will be used. If you want the value specifically from the Global Channel Map instead, you can use the map-specific get function shown in the Variable Maps section:
- var dataSource = globalChannelMap.get('dataSource');