Write New
The Write New stage writes events to an Output that doesn’t exist under the Connection. This is a more flexible away to control the Output settings and is recommended if Outputs definitions are not being shared between Pipelines.
Write Return
See the Write Stage for Write Return and success/failure paths.
Connection
Use the reference panel to define the Connection to use for the write. This controls the available output options.
Write Properties
Once a Connection is selected define connection-specific settings. See Connections for connector-specific details.
The properties of the new Target can be defined in three ways:
- Static/constant settings
- Dynamically using
{{}}
expressions like{{event.value.topic}}
. When defining properties this way, content within the{{}}
is evaluated as a Javascript. The expression can useevent
andSystem
object. As a more advanced example, an MQTT topic setting could be defined as{{event.metadata.baseTopic}}/{{event.value.name}}/{{new Date().toISOString()}}
- Dynamically using the Write Properties Expression field. This is only required for advanced use cases that require additional Javascript to generate the property settings. See below for additional details.
Advanced: Using a Write Properties Expression
Advanced use cases may require additional Javascript in order to generate the properties required to define the new Target. In the Write Properties Expression, use the event
and stage
objects to set properties based on event.value
.
This feature is most useful when setting properties that are not simple values, like arrays for example.
Examples below show how to set write values for single properties or multiple properties at once.
// Set a single topic for MQTT
stage.setWriteProperty("topic", "my/topic");
// Set multuple values
stage.setWriteProperties({topic: "my/topic", qos: 0});
}