Skip to content

Get Value By Key

Get Value By Key lets you pull out a single piece of information from a Data object.
Just give it the data and tell it which key to look for, and it will return that value.
If the key doesn’t exist, the output will be null (or an error if you’ve chosen that mode).

How it Works

When you drop this component into your workflow, it runs entirely on your local data:

  1. Receive the Data – The component accepts a single Data, Document, or dictionary.
  2. Read the Key – You type or map a key name. Use dot notation (data.text) for nested fields.
  3. Traverse the Structure – The component splits the key on dots and walks through the data hierarchy to find the value.
  4. Return the Value – The located value is output as a new Data object (via the get_value method).
    If the key isn’t found, the output is null (or an error if configured).

No external services are called; everything happens inside Nappai.

Inputs

  • Input Data: A single Data, Document, or dictionary that contains the information you want to extract.
  • Key: The key you want to pull out of the data.
    Use dot notation for nested keys (e.g., user.profile.email).

Outputs

  • Value: The extracted value, returned as a Data object.
    You can feed this output into other components, log it, or display it in the dashboard.

Usage Example

  1. Add the component to your flow and connect it to a data source that outputs user information.
  2. Set the Key to user.profile.email.
  3. Run the flow – the component will output the email address.
  4. Use the output to populate a field in a downstream form or to trigger a notification.

Important Notes

⚠️ Key must exist in the Data object 🟡
The component only returns a value if the specified key (including nested keys) exists. If the key is missing, the component returns null or may raise an error depending on your configuration.

💡 Use fully qualified nested keys 🟢
When accessing nested data, provide the full path using dot notation (e.g., data.text). This ensures the component looks in the correct place and avoids ambiguity.

⚙️ Match key names to your Data schema 🟡
Make sure the key you enter exactly matches the names defined in your Data object’s schema. Case‑sensitivity and spelling are important for successful extraction.

ℹ️ Only the value is returned 🟢
Unlike a full Data extraction, this component outputs just the single value found at the key. The rest of the Data object is not included in the output.

Tips and Best Practices

  • Always double‑check key names against your schema to avoid null results.
  • Use dot notation for clarity when working with nested objects.
  • Validate the output in a test run before deploying to production.
  • Handle missing keys gracefully by adding a simple condition that checks for null before using the value.