Template Node

Sets a property based on the provided template.

Inputs

msg object
A msg object containing information to populate the template.
template string
A template to be populated from msg.payload. If not configured in the edit panel, this can be set as a property of msg.

Outputs

msg object
a msg with a property set by populating the configured template with properties from the incoming msg.

Details

By default this uses the mustache format, but this can be switched off if required.

For example, when a template of:

Hello {{payload.name}}. Today is {{date}}

receives a message containing:

{
  "date": "Monday",
  "payload": {
    "name": "Fred"
  }
}

The resulting property will be:

Hello Fred. Today is Monday

It is possible to use a property from the flow context or global context. Just use {{flow.name}} or {{global.name}}.

Last updated on Oct 5, 2022

Newsletter

Subscribe to our newsletter to stay updated and to get notified once the platform officially launches:

By subscribing, you agree with Foretale’s Privacy Policy

© foretale - 2022