Add Query data to a form action to read matching records and pass their fields to later steps. For example, when a user selects a supplier, query a report by supplier ID and display the latest matching total on the form.
When to Use the Query Data Step
Use this step to look up a value or retrieve a page of records while a user works with a form or dashboard. For a lookup that runs inside a workflow, use the separate Query Data action.
Note
The Query data step is used in form actions on list forms, approval forms, and dashboards. The variable options depend on where you configure the action.
Configuring Query Data
Add the Query data step. If it should run only after the user supplies a value, set an Execution Condition. Execution conditions of actions
Choose the Application and Data source. You can query a data list, document library, form report, or data report.
Under Data filter, select Condition, then Add Condition. Choose the source field, comparison, and value. In the supplier example, compare the source's supplier ID with the ID selected on the form. Use the expression editor if the value comes from the current form or context. Add other conditions as needed.
Set Primary order and, if needed, Secondary order. For the latest supplier record, sort by date with the newest first. Use a second field to order records with the same date.
Under Query result, choose the result type and select Select fields beside Save values to variables.
Single item. Map fields from the first record in the configured result order. Select the fields you need and choose an Associated variable of the matching type for each field. For example, map the returned amount to a number variable.
Multiple items. Under Associated list, choose a sublist or an available list-type variable. Select the fields you want to return and map each one to a compatible field in that list. If needed, use Save the number of results to a variable to select a list field or temporary variable for the count. Page number defaults to 1. Page size defaults to 100 and accepts up to 1,000.
Tip. With a document library as the source, you can select Upload File in the field mapping.
Note
For an Associated list in a list form, look under List of Fields or Temp variables. In an approval form, look under Workflow variables or Temp variables.
Test a supplier with one match, one with several matches, and one with none. For several matches, check the first record against the chosen sort. For multiple items, check the mapped rows and which rows appear on a second page. If you configured the result-count variable, compare it with the known match count and the number of rows on each page before using it in later steps. Run a no-match lookup immediately after a successful one and check the mapped values and any later step that reads them. Configure a message or skip dependent steps if there is no usable result.

