What is AppliesTo Scripting?
Each DataSource has an AppliesTo field, which controls which hosts the DataSource is applied to. AppliesTo Scripting is the language used to express whether a DataSource applies to a device, given a device's properties as input. If, given the properties of the device as input, the AppliesTo Scripting expression evaluates to True, then the DataSource applies to the device. If not, the DataSource does not apply to the device. For an overview, see Determining Whether a DataSource Applies to a Device.
AppliesTo Scripting can also be used to build dynamic group queries, auto-assign device properties, or apply device dashboard templates to different devices.
For some quick examples, see the AppliesTo Scripting Examples.
AppliesTo Scripting Functions
There are several convenience functions defined in AppliesTo Scripting:
The following tests are available in AppliesTo Scripting expressions:
User Defined Functions
You can define your own functions globally, and those functions can then be called by any datasource. You can manage user defined functions from Settings | LogicModules | Functions:
For more information on creating, editing and deleting user defined functions, see this page.
Referencing Device Properties
Most AppliesTo Scripting expressions evaluate device properties. You can reference device properties in AppliesTo Scripting expressions exactly as they appear in the Info Tab for a device or group (as an unquoted string). Note that because system.categories and system.groups properties have multiple values, you'll need to use functions such as contains, hasCategory, getPropValue, or join to verify that a specific value is present (as opposed to using Boolean Operators).