Context Functions

Into page templates and JavaScript (e.g. widget, filters), you can use these functions to access the objects in the page context.

Function

Description

getAlert()

Returns the object describing the current context alert.
Available only when entering into an alert details page.

getCustomer()

Returns the object describing the current context customer.
Available only when entering into a customer, location or thing details page.

getCustomerServiceLevel()

Returns the object describing the service level associated with the current customer.

getCustomerTags()

Gets the list of tag definitions associated with the current context customer.

getEvent()

Returns the object describing the current context event.
Available only when entering into an event details page.

getLocation()

Returns the object describing the current context location.
Available only when entering into a location or thing details page.

getLocationTags()

Gets the list of tag definitions associated with the current context location.

getOrganizationTags()

Gets the list of tag definitions associated with the current context organization.

getPartner()

Gets the partner associated to the context thing or customer.

getPartnerTags()

Gets the list of tag definitions associated with the current context partner.

getServiceLevel()

Returns the object describing the service level associated with the current context thing.

getTags()

Gets the tags names associated with the current context thing.

getThing()

Returns the object describing the current context thing.
Available only when entering into a thing details pages.

getWorkSession()

Returns the object describing the current context work-session.
Available only when entering into a work-session details page.

getUser()

Returns the object describing the logged-in user.

isMobile()

Returns true in the case of mobile App navigation.

isTablet()

Returns true in the case of mobile App navigation from tablet.

For more details about the properties available within each object, refer to the REST API Reference page.

For more details about the expression syntax, refer to the AngularJS documentation.

Template Usage

<div *ngIf="getUser().customerId"></property>...</div>

JavaScript Usage

All the function above are bound to the JavaScript object named appUtils.

appUtils.getThing().properties.size > 100

appUtils.isMobile()