GETVARIABLE

The GETVARIABLE function retrieves the value associated to a flow variable.

This function returns a default value if specified, or an empty value if the flow variable has not been defined, or if it has been deleted prior to making this function invocation. Otherwise, it returns the associated value of the flow variable to the map in text format. The value associated to a special (reserved or internal) flow variable can be retrieved with this function for further transformation purposes.

Syntax:
GETVARIABLE ( single-text-expression [, single-text-expression])
Meaning:
GETVARIABLE ( variable_name [, default_value])
Returns:
A single text item

Examples

  • flowlib -> GETVARIABLE ("interest.rate", “10�? )

    Returns the current value of custom flow variable, interest.rate, to the map if it exists. Otherwise, returns the default value, 10, to the map.

  • flowlib GETVARIABLE ( "_FLOWINSTANCE_" )

    Special flow variables start and end with underscore. Returns the value of the special (reserved or internal) flow variable, _FLOWINSTANCE_, to the map.

  • flowlib -> GETVARIABLE ("myvar")

    Returns the value associated to myvar if set earlier through mapping functions (SETVARIABLE, INCVARIABLE, or DECVARIABLE), or through REST API. If not set earlier, returns empty.

  • flowlib -> GETVARIABLE ("myvar", "hello")

    Returns the value, hello, only when myvar is not set earlier, or found earlier. If myvar is set, then it would return the already set value to the map