Skip to main content
Version: 1.0.0

Combine two files

Related information is often stored in separate files. JQL can combine it in one query.

Source JSON

orders.json:

[
{"id": 101, "customerId": 1, "total": 80},
{"id": 102, "customerId": 2, "total": 25}
]

customers.json:

[
{"id": 1, "name": "Amina"},
{"id": 2, "name": "Jon"}
]

Query

jql "select {orderId: o.id, customer: c.name, total: o.total} from 'orders.json' as o inner join 'customers.json' as c on o.customerId = c.id"

Result

[
{"orderId": 101, "customer": "Amina", "total": 80},
{"orderId": 102, "customer": "Jon", "total": 25}
]

The short names o and c identify the two files. The on condition tells JQL which customer belongs to each order.