Json Array Union
A Flowgear processor node that merges multiple JSON arrays into a single array. It takes a parent JSON object containing a target array and appends elements from one or more child JSON arrays. The result is returned as a combined JSON document.
Revision History
1.0.0.0 Initial release
Properties
ParentJson
Type: JSON Input
The parent JSON document that contains the array into which child elements will be merged.
ParentArrayName
Type: String Input
The JSONPath of the array inside ParentJson
that will serve as the target array for the merge.
ChildJson
Type: JSON Input
The child JSON document that contains the array elements to be merged into the parent array.
ChildArrayName
Type: String Input
The JSONPath of the array inside ChildJson
that should be merged into the parent array.
Response
Type: JSON Output
The merged JSON document containing the updated parent array after all unions are performed.
Using the Node
1. Prepare Parent and Child JSON
Ensure you have a valid parent JSON document with a target array and one or more child JSON documents containing arrays you want to merge.
Example:
ParentJson
{
"employees": {
"records": [
{ "id": 1, "name": "ParentItem1" }
]
}
}
ParentArrayName
employees.records
ChildJson
{
"records": [
{ "id": 2, "name": "ChildItem1" }
]
}
ChildArrayName
records
2. Add Extra Children (Optional)
If you need to merge more than one child JSON, add additional key/value pairs in CustomProperties
. These must follow the naming convention <Prefix>Json
and <Prefix>ArrayName
. Each pair specifies another JSON document and array path to merge into the parent array. Use the convention:
GrandChildJson
GrandChildArrayName
And so on.
3. Run the Node
On invoke, the node will:
- Parse
ParentJson
and extract the array specified byParentArrayName
. - Parse
ChildJson
and append its array elements to the parent array. - Append array elements from any additional JSON documents defined in
CustomProperties
. - Return the updated parent JSON in
Response
.
Remarks
- If the specified array path cannot be found in any JSON document, the node will throw an error.
- This node does not perform duplicate checking – all child items are appended directly.
- Use when you need to consolidate multiple JSON array sources into a single unified array.