If you want to get data directly from one or more fields in a form to use as parameters in the Autofill query, you must provide placeholders in your query indicating that the actual data used in the query will come from the form. This is done using the special $PFF prefix followed by the exact name of the form field that will contain the data.
For example, the query below will use the value from a field in the form named region_code as its query parameter:
SELECT location_id, location_name, city FROM branch_locations WHERE region = $PFF.region_code
You may use multiple data elements from the form in your query by using this special syntax for more than one of your query parameters.
For example, this query uses data from two form fields named region_code and state, where the region_code column is a numeric column and the state_code column contains character data:
SELECT location_id, location_name, city FROM branch_locations WHERE region = $PFF.region_code AND state_code = '$PFF.state'
When you specify a form field as a query parameter using the $PFF syntax, make sure that you properly enclose the parameter in quotes if the query parameter is for a non-numeric column. If the query parameter is for a numeric column, then you may use it in your query without quotes.