Skip to main content

Context

This extension provides useful environment properties such as current region where the Stream App is running.

Features

  • getVar (var, default.value)

    This functions returns the value of the var if present. If the var is unknown to the Stream App, default.value (if specified) will be returned.

getVar

This functions returns the value of the var if present. If the var is unknown to the Stream App, default.value (if specified) will be 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 ruuning 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')];