Skip to main content
Version: 11.2

$.udb.genericHostVar()

note

This article is about the genericHostVar() function of the $.udb object.

$.udb.genericHostVar()

Assigns a value to a generic host variable. A generic host variable is a host variable (a name-value pair) that is needed in multiple actions or events. A host variable that is not generic is passed to the function performing the Page Engine call directly, as part of its options struct.

Returns a Map object containing all generic host variables, or the value of the variable that was referred to.

Syntax

$.udb.genericHostVar( [name], [value] )

Both parameters are optional. If no parameters are supplied, a Map with all the variables and their values is returned.

Name is the name of the variable, and value is the value being assigned to it. If value is not set, then the current value that corresponds with name is returned, and its value is not changed. If value is null, then the variable gets removed instead.

Generic host variables and their values are valid and included in every Page Engine call until they are removed with the $.udb.clearGenericHostVars() function, or until you navigate to another page.

Examples

$.udb.genericHostVar();
$.udb.genericHostVar('ID');
$.udb.genericHostVar('NAME', 'Jones');