A Node-RED node for interactive JSON filtering with selectable output structure and template editor.
npm install node-red-contrib-json-filter-advancedbash
npm install node-red-contrib-json-filter-advanced
`
Or install via the Node-RED palette manager.
Usage
$3
1. Drag the "json filter advanced" node into your flow
2. Double-click to open the configuration dialog
3. Select your data source:
- Use Latest Message: Work with live data from your flow
- Use JSON Template: Define a JSON structure for testing
$3
#### Property Selection
- Property: Choose which message property to filter (default: payload)
- Supports nested properties like data.items, response.body, etc.
#### Output Modes
- Object: Returns the filtered data as a nested object structure
- Flattened: Returns key-value pairs with dot-notation keys
- Array: Returns an array of the selected leaf values
#### Data Sources
- Use Latest Message: Automatically loads the structure from the last message received
- Use JSON Template: Define your own JSON structure for testing and development
$3
- Expand/Collapse: Click the arrow icons or use the "Expand All"/"Collapse All" buttons
- Selection: Check boxes to select specific fields
- Parent/Child Logic: Selecting a parent automatically includes its children
- Visual Feedback: Selected items are highlighted with different colors
Examples
$3
Input Message:
`json
{
"user": {
"name": "John Doe",
"email": "john@example.com",
"address": {
"street": "123 Main St",
"city": "New York",
"zip": "10001"
}
},
"timestamp": "2024-01-01T00:00:00Z"
}
`
Selected Paths: user.name, user.email, user.address.city
Output (Object mode):
`json
{
"user": {
"name": "John Doe",
"email": "john@example.com",
"address": {
"city": "New York"
}
}
}
`
Output (Flattened mode):
`json
{
"user.name": "John Doe",
"user.email": "john@example.com",
"user.address.city": "New York"
}
`
Output (Array mode):
`json
["John Doe", "john@example.com", "New York"]
`
$3
Input Message:
`json
{
"products": [
{
"id": 1,
"name": "Laptop",
"price": 999.99,
"category": "Electronics"
},
{
"id": 2,
"name": "Mouse",
"price": 29.99,
"category": "Electronics"
}
]
}
`
Selected Paths: products.name, products.price
Output (Object mode):
`json
{
"products": [
{
"name": "Laptop",
"price": 999.99
},
{
"name": "Mouse",
"price": 29.99
}
]
}
``