Skip to content

JSON: Get Value

Extracts a value from JSON data using a dot-separated key path. Supports dictionaries, lists, and JSON strings, automatically parsing strings when needed. Returns a default value when the path is missing, invalid, or leads to a null segment.
Preview

Usage

Use this node when you need to pull a specific field from structured JSON for downstream processing. Typical workflow: provide an API response or constructed JSON, specify a key path like user.name or items.0.title, and route the extracted value to subsequent nodes.

Inputs

FieldRequiredTypeDescriptionExample
json_dataTrueWILDCARDJSON input to read from. Can be a dict, list, or a JSON-formatted string that will be parsed.{"user": {"name": "Alex"}, "items": [{"title": "Book"}]}
key_pathTrueSTRINGDot-separated path to the target value. Use numeric segments to index lists.items.0.title
default_valueFalseWILDCARDValue to return if the path does not exist, is invalid, or resolves to a null segment.N/A

Outputs

FieldTypeDescriptionExample
valueWILDCARDThe value found at the specified key path, or the provided default when not found.Book

Important Notes

  • If json_data is a string, it will be parsed as JSON before path resolution.
  • An empty key_path returns the entire json_data as-is.
  • Use numeric segments (e.g., 0, 1, 2) to access list indices within the path.
  • If any path step is missing, invalid, or evaluates to null, the node returns default_value (or None if not provided).
  • Works with nested structures such as user.profile.name or config.servers.2.host.

Troubleshooting

  • Path not returning a value: Verify the key_path matches the structure and casing of your JSON keys.
  • Index errors on lists: Ensure numeric segments match valid indices (e.g., items.0 for the first element).
  • String input not parsed: Confirm the json_data string is valid JSON; otherwise provide a parsed object.
  • Unexpected None result: Provide default_value to avoid None when a segment is missing or null in the data.
  • Complex paths with numbers in keys: If object keys include dots or numeric-like names, consider restructuring data or extracting in steps to avoid ambiguity.