Reference Documentation

Design docs, concept definitions, and references for APIs and CLIs.

Device Attributes Filter


This component allows to filter incoming messages by attributes of the device. This filter is very useful if you want to apply rule only to certain sub-set of your device. Filter expression is a javascript expression and basically defines this sub-set. You are able to use any attribute types.


You are able to write boolean javascript expression using following bindings:

If you are not sure that certain attribute is present, you can add check it’s type for undefined. For example, filter below will match if client-side attribute ‘firmware_version’ is set and equal to ‘1.0.0’

typeof cs.firmware_version !== 'undefined' && cs.firmware_version === '1.0.0' 


Assuming following device attributes and their types

Following filter will match all premium subscription devices with positive balance that are located in USA with firmware version equal to 1.1.0

cs.firmware_version=='1.1.0' &&'USA' && shared.subscription_plan=='premium' && ss.balance > 0

If you are not sure that all attributes are present for your device, you should use following syntax that adds all necessary “null” checks

typeof cs.firmware_version !== 'undefined' && 
typeof !== 'undefined' && 
typeof shared.subscription_plan !== 'undefined' && 
typeof ss.balance !== 'undefined' && 
cs.firmware_version=='1.1.0' &&'USA' && shared.subscription_plan=='premium' && ss.balance > 0