Message Formatter
1. Overview
The Message Formatter component (message-formatter) builds a text from a template that can include data from the current message, replacing the message body with the resulting text. Useful for building simple text messages (notifications, logs, plain-text email bodies) combining flow data with fixed text.
Use it when you need to build a formatted string from flow data. For richer formats (with conditional logic, loops, tables), prefer the Freemarker component.
2. Prerequisites
No credentials or external access — local processing.
3. Authentication and Connection
Not applicable.
4. Configuration / Supported Operations
The component has a single operation: build the final text from a template.
| Field | Required | Type | Description | Example |
|---|---|---|---|---|
message | No | Text (template/expression) | Text or expression that will be resolved using the current message's data. If it doesn't resolve to any value, the result is an empty string. | "Order {$.body.orderId} confirmed for {$.body.customer.name}" |
5. Practical Examples
Simple example: build an order-confirmation message using data from the message body.
Input:
{
"orderId": 981,
"customer": { "name": "Maria Silva" }
}
Component configuration:
{
"componentName": "message-formatter",
"configurations": {
"message": "Order {$.body.orderId} confirmed for {$.body.customer.name}."
}
}
Response (the message body becomes the built text):
"Order 981 confirmed for Maria Silva."
Advanced example: build the text body of a notification, combining several fields, to then use in the Email component (textMessage) or WhatsApp.
Input:
{
"orderId": 982,
"customer": { "name": "John Smith" },
"delivery": { "estimate": "07/25/2026" }
}
Component configuration:
{
"componentName": "message-formatter",
"configurations": {
"message": "Hello {$.body.customer.name}, your order {$.body.orderId} arrives on {$.body.delivery.estimate}."
}
}
Response:
"Hello John Smith, your order 982 arrives on 07/25/2026."
6. Common Errors and Troubleshooting
| Error / Symptom | Likely Cause | How to Fix |
|---|---|---|
| Result always empty | The message field wasn't filled in, or the expression used didn't resolve to any value. | Fill in message and review whether the paths used exist in the input message. |