ShareMaster is shaped by your feedback. Tell us what to build next →
Features All features overview
Migration Tools Overview Structure and content OneDrive ↔ SharePoint Content only Structure only Move / Copy Upload from this computer Download to this computer Dropbox to SharePoint Resume and incremental runs
Microsoft Teams Overview Copy a team Move channels Merge teams Inactive teams Ownerless teams Guests and external access Export a team Search everyone's chats
Recycling Bin Overview Browse a site's recycle bin Empty recycle bins in bulk Restore and purge history Deleted teams
Archive Overview Configure the tenant On Demand Archive Restore Archived Files Archive Savings Report Blob Viewer
Optimise Storage Tools Overview Delete all items in a list Delete all files and folders in a library Remove empty folders Remove duplicate files Reduce image sizes Delete sites and subsites
SharePoint Tools Overview Tenant Explorer SharePoint Explorer Easy Settings Fix renamed groups List Explorer Search the Preservation Hold Library
Search & Indexing Overview Search query Item search properties Reindex Crawl log
Replace Overview Replace in SharePoint Replace in local files Find password-protected files Remove PDF passwords
Shared Links Overview Report shared links Report unique permissions Remove a person from sharing links Remove shared links Remove unique permissions
Version History Overview Version trimming Version trimming report Reset file version
Reports Overview Inventory report Folder inventory Site and subsite storage Storage growth Security matrix Teams permissions Pre-migration analysis Compare items Dropbox to Microsoft 365 compare Duplicate file report Empty folder report Image size report Recycle bin report Unused licences Copilot readiness Inactive sites, OneDrives and groups Orphaned users Site settings Audit activity Groups Checked-out files report Report history
Developer Tools Overview Query Builder PnPjs Console Property Bags SPFx Customizers Webhooks Customisation audit
Pricing Services Demos Blog Guides Use cases Compare Tools Alerts FAQ Contact
  1. Home
  2. Documentation
  3. Developer tools

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.

Reads only. Nothing in SharePoint is changed.

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

  1. Sign in. One sign-in when you click the tile. Any of the three credentials works.
  2. Choose a site. Then pick a list (step 1). Lists over 5,000 items are flagged.
  3. 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.
  4. 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.
  5. 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.
  6. 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.

See every feature