langflow-ai / langflow

Langflow is a low-code app builder for RAG and multi-agent AI applications. It’s Python-based and agnostic to any model, API, or database.
http://www.langflow.org
MIT License
36.69k stars 4.3k forks source link

Feat: Add JSONPath Query Support for Dynamic JSON Data Extraction. #4965

Open irshadmb opened 2 days ago

irshadmb commented 2 days ago

Title

Feat: Add JSONPath Query Support for Dynamic JSON Data Extraction.

Type

New Feature

Description

This feature will allow users to input a JSON object and specify a JSONPath expression to extract specific data points efficiently.

Key Features:

Use Case

Dynamic JSON Data Extraction with JSONPath

Use Case Overview

A developer is working with a JSON response from an API and needs to extract specific data points dynamically. Instead of manually traversing the JSON structure or writing custom code for each query, the developer can use the JSONPath feature to streamline the process.

Example Workflow

Input JSON

The developer provides a JSON object, such as:

{
  "store": {
    "book": [
      {"category": "fiction", "title": "Book A", "price": 10.99},
      {"category": "non-fiction", "title": "Book B", "price": 12.99}
    ],
    "bicycle": {"color": "red", "price": 19.99}
  }
}

JSONPath Query

The developer specifies a query to extract all book titles:

$.store.book[*].title

Result

The system processes the query and returns the following result:

["Book A", "Book B"]

Benefits

Conclusion

This use case demonstrates how JSONPath functionality simplifies working with structured JSON data, making it a valuable tool for developers.

Implementation Plan

No response

irshadmb commented 2 days ago

I am working on the same. A PR has been created.