Skip to main content

getVar

This functions returns the value of the var if present. If the var is unknown to the stream worker, default.value (if specified) are returned.

Syntax

<STRING> context:getVar(<STRING> var, <STRING> default.value)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
varThe variable name whose value should be returned.STRINGNoYes
default.valueIf the var is unknown default.value will be returned.nullSTRINGYesYes

Supported Context Variables

NameDescription
regionCurrent region where the Stream App is running e.g. gdn-sfo2

Example 1

insert into OutputStream
select customerName, context:getVar('region') as region
from InputStream;

Example 2

insert into OutputStream
select customerName
from InputStream[region == context:getVar('region')];