Analytics Builder 10.9.0 | Using Analytics Builder for Cumulocity IoT | Block Reference | Utility | Text Substitution
 
Text Substitution
apama.analyticsbuilder.blocks.TextSubstitution
Substitutes identifiers marked with a hash and braces (for example, #{name}) in the text template with corresponding entries from the input values.
At least one of the Object or Source input ports must be connected. Identifiers that cannot be resolved are not substituted.
The identifiers prefixed with source. (for example, #{source.name}) are searched for in the value received on the Source input port. For example, if the value received on the Source input port is { "name": "sample_name" }, then the identifier #{source.name} is resolved to sample_name.
The identifiers not prefixed with source. are searched for in the value received on the Object input port.
Nested identifiers can be specified by separating them with a dot (.). For example, when the Object input port has received the value { "address": { "street": { "name": "example_street" }}}, then the identifier #{address.street.name} is resolved to example_street.
Keys with a dot (.) in them are not supported, so if the Object input port value is of the form { "address.street": { "name": "example_street" }}, then the example_street value cannot be resolved because the identifier #{address.street.name} expects street to be nested inside the address entry.
Primitive values such as integer, float, boolean and string are substituted directly, but complex values are converted to a JSON representation before substitution.
Any identifier with the text time (case-insensitive) in it and value type float is interpreted as a timestamp value and is converted into the format yyyy-MM-ddTHH:mm:ss.SSSZ before substitution.
A hash (#) can be specified in the text template by escaping it as follows: #{#}.
Parameters
Name
Description
Type
Notes
Text Template
The text that is used to generate the output by substituting the identifiers in it, such as #{name}, with the values from the input ports.
string
Input Port Details
Name
Description
Type
Object
Used to substitute identifiers that are not prefixed with source.. For example, #{name} or #{timestamp}.
any
Source
Used to substitute identifiers that are prefixed with source.. For example, #{source.name}.
any
Output Port Details
Name
Description
Type
Output
String containing the substitutions from the text template.
string