Automation Placeholders

Prev Next

When defining an automation action, you can use the following placeholders to make actions dynamically dependent on the automation context.

The placeholder must be included using this syntax:

// URL
PUT https://my-backend.com/api/customers/${customer.id}

// URL
DELETE https://my-backend.com/api/customers?customerId=${customer.id}

// Header
X-Product: ${thing.serialNumber}

// mail message
WARNING: High temperature detected on ${thing.name} (${metrics.temperature.value} ${metrics.temperature.unit})

Here below you can find the full list of placeholders that can be used into an automation's action.

PLACEHOLDER

DESCRIPTION

SAMPLE VALUE

timestamp

The timestamp at which the automation has been triggered

1476271832909

metrics.<METRIC_NAME>.value

The value of the <METRIC_NAME> metric

101, true, 12.77, LOW_WATER

metrics.<METRIC_NAME>.unit

The measuring unit of the <METRIC_NAME> metric

Kg, m

metrics.<METRIC_NAME>.valueLabel

The label associated with the value in case of dictionary and thresholds.

HIGH

metrics.<METRIC_NAME>.valueSeverity

The severity associated with the value in case of dictionary and thresholds.

CRITICAL

thing.id

The thing identifier

661fa918281ccf25619dc5cc

thing.name

The thing's name

Printer-floor1

thing.serialNumber

The thing's serial number

XY000001

thing.properties.<PROP_NAME>

The value of the property named <PROP_NAME>.

thing.serviceLevel

The Service Level name associated with the Thing

GOLD

thingDefinition.id

The thing definition identifier

661fa918281ccf25619dc5cc

thingDefinition.name

The thing definition model name

Mod123

thingDefinition.properties.<PROP_NAME>

The value of the property named <PROP_NAME>.

workSession.name

The name of the started/completed work session

CLEANUP

workSession.data

The JSON describing the entire started/completed work-session.

{
"id":"2gh4h45h54",
"startTimestamp":12343,
…
}

partner

The JSON describing the partner where the event has been detected.

{
"id" : "6w3e4r5t6y7ujh"
"name": "Service 24h",
…
}

customer

The JSON describing the customer where the event has been detected.

{
"id" : "6w3e4r5t6y7ujh"
"name": "Abon Metal",
…
}

location

The JSON describing the location where the event has been detected.

{
"id" : "6w3e4r5t6y7ujh"
"name": "Plant A",
…
}

thing

The JSON describing the thing where the event has been detected.

{
"id" : "6w3e4r5t6y7ujh"
"name": "Sawing-123",
…
}

user

The JSON describing the user for whom the event has been detected.

{
"id" : "6w3e4r5t6y7ujh"
"email": "mark.hamill@acme.com",
......
}

order

The JSON that describes the order in which the event has been detected.

{
"id" : "6w3e4r5t6y7ujh"
"buyer": {...},
"items": [{...}, {...}],

…
}

executor.email

In case of a user-performed event, the email of the user who operated.

mark.hamill@acme.com

subscription

The full JSON of the updated subscription object.

payment

The full JSON of the updated payment object.

{

"id" : "6w3e4r5t6y7ujh"
“paymentNumber”: “PAY-123“,

"amount": 650,
"items": [{...}, {...}]

}

payment.items.toHtml

Prints out the list of items in a readable format (HTML).

<div>….</div>

now

The timestamp when the automation is executed.
See Formatting date/times section for more details.

1793356941000

Formatting date/times

By default, timestamp values are replaced with the time value in milliseconds, but it is possible to use the following placeholder suffixes to format date/time in a friendly way:

toUTCFormat

Formats the date/time using the UTC timezone.

thing.activationTimestamp.toUTCFormat → 2018-03-25 10:34:22 UTC

toLocaleFormat

Formats the date/time using the user's preferred timezone.

thing.activationTimestamp.toLocaleFormat → 2018-03-25 11:34:22

toFileName

Formats the date/time using a file name compatible format (yyyyMMdd_HHmm).

thing.activationTimestamp.toFileName→ 20180325_1134

Deprecated Placeholders

PLACEHOLDER

DESCRIPTION

parameter.name

The name of the updated parameter. (DEPRECATED)

parameter.value

The value of the updated parameter. (DEPRECATED)

command.name

The name of the executed command. (DEPRECATED)

command.data

The parameters of the executed command. (DEPRECATED)