Message to Data
The Message to Data component takes a Message object that you have received or created in your workflow and turns it into a Data object. This makes it easy to pass the information to other components that expect data in the Data format.
How it Works
When you drop this component into your dashboard, you connect a Message object to its Message input. The component checks that the input is indeed a Message. If it is, it extracts the underlying data from the Message and wraps it in a new Data object. The result is then available on the Data output. If the input is not a Message, the component returns a Data object that contains an error message so you can see what went wrong.
Inputs
- Message: The Message object you want to convert into a Data object.
Outputs
- Data: A Data object that contains the same information that was inside the original Message. If the conversion fails, this output will contain an error message instead.
Usage Example
- Create or receive a Message – For example, you might have a component that pulls an email or a chat message and outputs it as a Message object.
- Add the Message to Data component – Drag the component onto the canvas and connect the Message output to its Message input.
- Use the Data output – Connect the Data output to any component that requires data in the Data format, such as a database writer, a data transformer, or a downstream AI model.
This simple step lets you move information from a messaging context into a data context without any extra coding.
Related Components
- Data to Message – Converts a Data object back into a Message object for sending or displaying.
- Message to Text – Extracts plain text from a Message object for use in text‑based components.
Tips and Best Practices
- Validate the input – Make sure the component you feed into the Message input actually outputs a Message object; otherwise you’ll get an error in the Data output.
- Check the Data output – If you see an error message in the Data output, verify that the source component produced a valid Message.
- Use the Data output downstream – Many components in Nappai accept Data objects, so converting early can simplify your workflow.
Security Considerations
This component only processes data that is already present in your workflow; it does not call any external APIs or services. The main risk is accidental exposure of sensitive information if the Message contains confidential data. Handle the resulting Data object with the same care as you would any other sensitive data in your system.