Query List
Queries list item data and stores the results in a workflow variable.
The action performs a CAML site data query.
Action Settings
Editor Mode
Choose whether to use the UI to build the query, or edit the CAML manually.
- CAML editor use the CAML Editor mode to create more advanced cross list queries. View the CAML at any time by switching to the CAML Editor mode.
- Query builder can build queries for a single list in the same team site as the workflow.
Editor Mode: Query Builder
In Query builder mode, the following elements will build the query:
List
Select the list to query data from. Lists in the current team site are displayed.
Recursive
Check this option to query for items within folders and subfolders.
Filter
The criteria that nominated list items must match in order to be selected.
Sort
The order in which selected values should be returned.
XML encode inserted tokens
This option ensures that the inserted tokens will be encoded and is able to support special characters.
Output options
Include HTML formatting in rich text columns: This option determines how a value queried from a rich text field is returned. When this option is selected, the HTML mark-up from the field will be preserved. When this option is not selected, HTML mark-up is removed, leaving only the text.
Specify item limit: Specify the maximum number of items to be returned from the query.
Field
The field to retrieve the data from. More than one field can be selected.
- Select the required field to retrieve the data from and click Add.
- Specify a workflow variable to store the values from the field to be retrieved.
Note: If a variable that is not a collection is selected, only the first result will be stored.
Editor Mode: CAML Editor
When CAML editor is selected, the query can be run on either the current site or an alternate site to the one the workflow is running in.
To query an alternative site, select the Alternative site option and enter the Site URL to a SharePoint site. The site must exist in the same farm as the workflow, but can be in a different site collection or web application.
When the Alternative site is selected, the Query builder mode is disabled.
XML encode inserted tokens
Output options
Include HTML formatting in rich text columns: This option determines how a value queried from a rich text field is returned. When this option is selected, the HTML mark-up from the field will be preserved. When this option is not selected, HTML mark-up is removed, leaving only the text. For more information about CAML queries and Site Data queries, see the SharePoint SDK.
Specify item limit: Specify a number of items to be returned from the query.
Field: The field to retrieve the data from. More than one field can be selected.
1. Select the required field to retrieve the data from and click Add.
2. Specify a workflow variable to store the values selected from the field query.
Note: If a variable that is not a collection is selected, only the first result will be stored.