Query Builder
Build and test CAML and OData
Build a list query once and get it three ways: a CAML view, an OData query string and a PnPjs snippet. All three come from one expression, so AND, OR and brackets mean the same thing in each. Test it against the list and see exactly how SharePoint answers, including the list view threshold.
What does it tell you?
- Why does this CAML query return nothing, or get refused on a big list?
- What is the OData filter for this condition, with the quotes escaped properly?
- Is the column I am filtering on indexed?
How it runs
- Sign in. One sign-in when you click the tile. Any of the three credentials works.
- Choose a site. Then pick a list (step 1). Lists over 5,000 items are flagged.
- Build. Step 2 adds filters (no filter means every item; Group with brackets to group them), step 3 the columns, step 4 the sort and how many items. The query shows on the right as you build it, in plain English and as CAML, OData, PnPjs or REST.
- Or build it with AI. Optional, with your own AI key (Settings, AI keys). Describe the items in words and Build with AI fills steps 2-4; a follow-up such as "also only PDFs" changes that query. Its query is checked against the list's real columns first, and it asks before replacing a query you built. It says what it built and what the request cost. Nothing runs until you run it.
- Run. Run query sends one request: as CAML it posts the view, as OData it reads the items endpoint. The items, or SharePoint's refusal, show in the Preview.
- Use it. Copy the form on show, save the query (under More), or export the items to Excel.
How does it work?
The Query Builder only reads. It loads the site's lists with their item counts and the chosen list's columns, and every filter row, bracket, column choice, sort, row limit and folder scope feeds one expression from which the CAML, the OData query string and the PnPjs snippet are all written. A filter that cannot be built (unbalanced brackets, an operator that does not suit the column) is shown as an error and Run query is off until it is fixed.
Today plus or minus a number of days is left to SharePoint in the CAML, so a saved CAML query keeps meaning today. OData has no such token, so its date is worked out when the query is built and written as a fixed date. On a list over 5,000 items, the page warns when the first filter is not on an indexed column, because SharePoint will refuse that query.
Run query as CAML asks SharePoint to render the list with your CAML as the view; as OData it reads the list's items with your query string. Each run sends exactly one request as you and is deliberately not routed through the threshold-safe reading the rest of ShareMaster uses, so you see SharePoint's real answer. A list view threshold refusal is explained as such with the indexing advice, never shown as an empty result. The grid shows a lookup or person value by its display text.
Saved queries are kept in a file on this computer and hold the query's definition (site, list, filters, columns, sort, limit and scope), not its results. Export to Excel writes the rows from the last run and a second sheet with the site, list, the query in words, CAML and OData that produced them.
What do you need?
- Read access to the list. The tests run as you, so you see what this sign-in can see.
- For Build with AI only: your own Anthropic, OpenAI or Azure OpenAI key. Without one, the builder works by hand.
What will it not do?
- Each run reads one page of at most 5,000 rows. There is no paging loop, on purpose: the point is to see how SharePoint answers this exact query.
- Lookup and person columns are compared by item or user id.
- Build with AI sends your words, the list's name and item count, its column names, types and choices, and the query on screen to your AI provider. It never sends an item, and it cannot pick a person by name: person and lookup filters still need the id.
- SharePoint's items API cannot filter a managed metadata column; Run query as OData is off for that, and as CAML still works.
- An OData address over 2,048 characters is refused by some proxies, so running as OData is off past it. As CAML it is a POST body and still works.