Parameters are the values a query receives each time it runs: the uuid of a row to load, a search term, or the new status to write.
A query is saved once and runs many times. Parameters are the parts that change between runs. The function that runs the query supplies them.
You can use a parameter in a WHERE condition, in an INSERT value binding and in an UPDATE value.
1
Open the query
Go to Database, then Custom Queries, and click Edit Query.
2
Open Parameters
Click Add Parameter.
3
Describe it
Fill in Variable Name (the name the query and the function use), Display Label, and Data Type.
4
Mark it Required if needed
A required parameter must arrive every time the query runs.
Data Type
String, Int, Float, Boolean, Date or UUID.
Add parameters before you build the query. The Query Builder only offers parameters that already exist.
Wherever the Query Builder lets you type a fixed value, you can pick a parameter instead.
In a WHERE condition, pick a parameter instead of typing a fixed value.
In INSERT Value Bindings, bind a column to a parameter so each new row gets the value that arrives.
In an UPDATE query, use parameters both in Values to write and in Which rows to change.
In the function's Node Editor, add an Execute Query node and choose your query in Configure Database Query. The node gets one input port for each active parameter, named after it.
Connect a value to each port: a function input, a page value passed in by a page event, the signed-in user's id from the Get User ID node, or a constant.
How a query behaves when a value does not arrive depends on where the parameter is used.
A condition you build in the Query Builder expects its parameter on every run. If the value is missing, the run fails.
In an UPDATE query, a value to write whose parameter is missing leaves that column unchanged.
Every parameter used in Which rows to change must be Required.
Deactivating a parameter on the Parameters tab skips every condition that uses it. Deactivate with care: a skipped filter returns more rows.