Skip to main content

staticLookup

A Workflow Engine function that searches for a key in a static lookup table, retrieves the corresponding value, and applies that value to a field in the object. lookupName references a .lookup file in JSON format in the following folder: $MOOGSOFT_HOME/config/lookups/.

For example, Locations refers to $MOOGSOFT_HOME/config/lookups/Locations.lookup. On first use, the lookup loads into constants. You do not need to edit the Workflow Engine Moobot to load. The default lifespan for the lookup is 3600 seconds, after which the Workflow Engine reloads the file.

This function is available for event, alert, and Situation workflows.

Back to Workflow Engine Functions Reference.

Arguments

Workflow Engine function staticLookup takes the following arguments:

Name

Required

Type

Description

key

Yes

String

Source field to use as the key.

lookupName

Yes

String

Name of the lookup. Corresponds to a lookup file in $MOOGSOFT_HOME/config/lookups/lookupName.lookup.

field

Yes

String

Field to set the result of the lookup to. If the lookup is unsuccessful, this is set to null or if there is a key named 'default' the values are taken from that.

lifespan

Yes

Number

Lifespan of the current lookup data in memory before the Workflow Engine reloads the data from disk. Default is 3600 seconds.