Extract Key From Data
Extract Key From Data is a simple tool that lets you pull out particular pieces of information from a data object. Think of it like a pair of scissors that cuts out only the parts you need, leaving the rest untouched.
How it Works
When you drop a data object into this component and list the keys you want, the component looks inside the object for those keys. For each key it finds, it copies the value into a new, smaller data object that contains only the requested keys. If a key isn’t present, the component can either ignore the missing key (the default) or raise an error so you know something went wrong.
Inputs
- Data: The data object you want to pull information from. This could be any structured data that the system can read, such as a record from a database or a response from another component.
- Keys: A list of the key names you want to extract. Enter the names exactly as they appear in the data object.
- Silent Errors: If set to True (the default), the component will quietly skip any keys that aren’t found. If set to False, it will raise a clear error message when a key is missing.
Outputs
The component returns a new data object that contains only the keys you requested, each paired with its original value. This trimmed data can then be fed into other components or used to display results in the dashboard.
Usage Example
- Add the component to your workflow and connect a data source (e.g., a “Get User Info” component) to the Data input.
- In the Keys field, type the names of the fields you need, such as
["name", "email"]
. - Leave Silent Errors as the default unless you want the workflow to stop if a key is missing.
- Connect the output of this component to the next step, like a “Display Data” component, to show the extracted information.
The workflow will now only carry forward the user’s name and email, making downstream steps faster and easier to manage.
Related Components
- Get Data – Pulls data from a database or API.
- Filter Data – Keeps only rows that meet certain conditions.
- Transform Data – Modifies or enriches data fields.
- Display Data – Shows data in the dashboard or exports it.
Tips and Best Practices
- Check key names carefully – Typos will cause the key to be silently ignored unless you set Silent Errors to False.
- Use Silent Errors = False during testing to catch missing keys early.
- Combine with Filter Data if you only need a subset of records before extracting keys.
- Keep the output small – Only extract the fields you truly need to reduce memory usage.
Security Considerations
- The component works entirely on data already present in the system; it does not call external services.
- Be mindful of sensitive information that may be included in the extracted keys.
- If the data contains personally identifiable information (PII), ensure that downstream components handle it according to your organization’s privacy policies.