Supported placeholders for the thing template

The thing template supports header and solution placeholders as well as placeholder functions.

Header placeholders

{{ header: }}

This placeholder supports any external protocol header or Things header.

Examples

{{ header:correlation_id }}

{{ header:device_id }}

Solution placeholders

{{ solution:id }}

The ID of the solution that owns the connection.

{{ solution:service-instance-id }}

The service instance ID of the solution.

{{ solution:package-service-instance-id }}

The service instance ID of the package to which the solution belongs (i.e. the service instance ID without _things suffix).

Placeholder functions

fn:default(<string|placeholder> defaultValue)

This placeholder function will pass the defaultValue if the previous expression in a pipeline has been resolved to empty (e.g. due to a non-defined header placeholder key).

Another placeholder may be specified, which is resolved to a string and inserted as defaultValue.

Examples

{{ header:my-optional-header | fn:default('fallback') }}

{{ header:my-optional-header | fn:default("fallback") }}

{{ header:gatway-id | fn:substring-before(':') | fn:default(header:device-id) }}

fn:substring-before(<string> givenString)

This placeholder function will parse the result of the previous expression, then it will pass along only the characters before the first occurrence of the givenString.

If givenString is not contained, this function will resolve to empty.

Examples

{{ header:device-id | fn:substring-before(':') }}

{{ header:device-id | fn:substring-before(":") }}

{{ header:gateway-id | fn:substring-before(':') | fn:default(header:device-id) }}

fn:substring-after(<string> givenString)

This placeholder function will parse the result of the previous expression, then it will pass along only the characters after the first occurrence of givenString.

If givenString is not contained, this function will resolve to empty.

Examples

{{ header:device-id | fn:substring-after(':') }}

{{ header:device-id | fn:substring-after(":") }}

{{ header:gateway-id | fn:substring-after(':') | fn:default(header:device-id) }}

fn:lower()

This placeholder function makes the string result of the previous expression lowercase in total.

Examples

{{ header:device-id | fn:lower() }}

fn:upper()

This placeholder function makes the string result of the previous expression uppercase in total.

Examples

{{ header:device-id | fn:upper() }}