Skip to main content
Runs a SQL query against a database and places the rows it returns into your data. Use this to read records straight from a database in the middle of a route, for example pulling order lines, looking up stock levels, or fetching customer details to enrich the data flowing through. The rows come back as a list at the location you choose, ready for the next steps to work with.

Fields

Sample data

This step runs a live query against the database, so the rows you get back depend on the data in your database. The example below looks up a product by the incoming sku and places the matching rows at matches.
FieldValue
Database connectionThe configured database connection
QuerySELECT sku, name, price FROM products WHERE sku = '&{sku}'
Destinationmatches
For an input of { "sku": "SHIRT-RED-M" }, the returned rows are placed at matches:
{
    "sku": "SHIRT-RED-M",
    "matches": [
        {
            "sku": "SHIRT-RED-M",
            "name": "Red T-Shirt M",
            "price": 19.95
        }
    ]
}
A query that returns no columns (such as an UPDATE or INSERT) places an empty list at the destination. See Placeholders for how to reference values such as &{sku} when building the query.