DELETEVARIABLE

The DELETEVARIABLE function deletes a flow variable defined for a flow.

The Special (reserved or internal) flow variables cannot be deleted with this function. All flow variables, custom and special, are deleted by default when flow instance finishes its execution. Use this function when a flow variable must be removed from the visible scope of nodes in a flow execution. A flow variable has to be deleted as setting empty value does not affect the value or existence of the 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 and deletes the flow variable from the scope of flow instance.

Syntax:
DELETEVARIABLE (single-text-expression [, single-text-expression])
Meaning:
DELETEVARIABLE (variable_name [, default_value])
Returns:
A single text item if found, otherwise none

Examples

  • flowlib ->DELETEVARIABLE (“Greeting”)

    Deletes flow variable, Greeting, if defined and returns value associated to it. Otherwise, returns empty.

  • flowlib ->DELETEVARIABLE (“Greeting”, “Hi”)

    Deletes flow variable, Greeting, if defined and returns value associated to it. Otherwise, returns default value, Hi, to the map.