Synthetic variables' editor

The Synthetic Variables editor lets you write and configure the expression to compute.

In the bottom-right corner, a message shows whether the expression is valid and can be computed, or whether it has a syntax error that you need to fix.

Timezone

The editor lets you select a timezone to reference a variable's timestamps for a specific location. This is useful when you calculate a variable for a client, user, or process in a different timezone.

Context

Synthetic Variables support context data. You can use the raw variable's context in the synthetic expression, as long as the context value is numeric. To access it in the editor, use the dot . operator on the variable, then add context and the context key:

Timestamp

Like context data, you can access timestamps in synthetic variables with the dot . operator.

Device properties

You can use device properties in a synthetic variable expression, as long as the property is a floating-point number. To access the device object from the editor, use one of the following formats:

Using a device's ID:

Using a device's label:

Then use the dot operator . to access the device's properties:

Replace <device> with the device id or label.

Then access any device property with its key:

Here, <key> is the property key.

For example, to retrieve the uptime property from a device whose ID is 65fb47fad809281764f8a350, use:

To use device properties in a synthetic variable, include them in a mathematical expression with another variable. That expression determines how new values are calculated.

Using device properties from device types synthetic variables editor

You can also create a synthetic variable across device types from the Synthetic Variables editor in the Device Types module with this syntax:

Replace <key> with the property key you want to use. The self keyword is a placeholder that resolves to the actual device ID for each device in the device type.

Last updated

Was this helpful?