Parse Data
Parse Data is a simple tool that takes structured data (like a JSON object) and turns it into a readable text string. You can also add extra information (metadata) to the output and rename that metadata if you want.
How it Works
When you drop data into the Data input, the component looks at the Template you provide. The template can contain placeholders such as {name}
or {metadata.source}
.
The component replaces each placeholder with the corresponding value from the input data.
If you list keys in Metadata keys, those pieces of data are copied into the Processed Data output.
With Metadata Schema you can rename those keys (e.g., change metadata.source
to source_url
).
The Result Key tells the component what name to give the formatted text inside the data
dictionary of the Processed Data output.
The Separator lets you decide how multiple pieces of text are joined together (default is a space).
All of this happens inside Nappai – no external API calls are made.
Inputs
- Data: The data you want to turn into text.
- Metadata keys: A comma‑separated list of keys (you can use dot notation for nested keys, e.g.,
metadata.source
). These keys will be copied into the Processed Data output. - Metadata Schema: A JSON object that maps the original metadata keys to new names (e.g.,
{"metadata.source": "source_url"}
). The keys must match those listed in Metadata keys. - Result Key: The key name that will hold the formatted text inside the
data
dictionary of the Processed Data output. - Separator: A string that separates multiple pieces of text when they are combined.
- Template: The text format you want to use. Placeholders are written with curly braces, e.g.,
{name}
or{metadata.source}
. Nested keys are accessed with dot notation.
Outputs
- Text: A message that contains the formatted text.
- Processed Data: A data object that includes the original data, the selected metadata (renamed if a schema is provided), and the formatted text under the key you specified with Result Key.
Usage Example
-
Input data
{"name": "Alice","age": 30,"metadata": {"source": "CRM System","id": "12345"}} -
Configure the component
- Metadata keys:
metadata.source,metadata.id
- Metadata Schema:
{"metadata.source": "source_url"}
- Result Key:
summary
- Separator:
|
- Template:
Name: {name}Age: {age}Source: {metadata.source}
- Metadata keys:
-
Result
- Text:
Name: AliceAge: 30Source: CRM System
- Processed Data:
{"data": {"summary": "Name: Alice\nAge: 30\nSource: CRM System"},"metadata": {"source_url": "CRM System","id": "12345"}}
- Text:
You can now feed the Processed Data into another component, such as an email sender or a database writer.
Related Components
- Data Filter – Selects specific parts of your data before it reaches Parse Data.
- Data Transformer – Modifies or enriches data fields that Parse Data will format.
- Send Email – Uses the formatted text from Parse Data as the email body.
- Data Export – Saves the processed data to a file or database.
Tips and Best Practices
- Keep your template simple; each placeholder should map to a single key.
- Use dot notation (
{metadata.source}
) to pull nested values. - If you need to rename metadata, always provide a matching key in Metadata Schema.
- Test your template with sample data to ensure placeholders resolve correctly.
- Use the Separator to join multiple lines or values cleanly.
Security Considerations
- All processing is done locally within Nappai; no data leaves the system.
- Be cautious when including sensitive information in the template, as the resulting text will be exposed to downstream components.
- If you are sending the output to external services (e.g., email, API), ensure those services are secured and comply with your organization’s data handling policies.