Five Number tools › SharePoint REST Query Builder
SharePoint REST Query Builder
Build a SharePoint REST _api query without remembering the OData quirks. Pick an endpoint, set $select, $filter, $expand, $orderby and $top, and get the URL plus the Power Automate HTTP action, PnP.js, PnP PowerShell and cURL. It handles the SharePoint-specific bits: datetime'...' dates, substringof with its reversed arguments, and the $expand a lookup needs.
Start from an example
Build the query
Combine with
Output
REST URL
Power Automate (Send an HTTP request to SharePoint)
PnP.js (TypeScript)
PnP PowerShell
cURL
SharePoint REST notes
- Field names are internal names, not display names. “Assigned To” is usually
AssignedTo, and a space in a name becomes_x0020_. - Dates use the OData v3 literal,
Modified ge datetime'2026-01-01T00:00:00', not a bare ISO string. - Contains is
substringof('text', Field)with the value first, which is the reverse ofstartswith(Field, 'text'). SharePoint REST has noendswith. - Lookup and person fields: filter by id with
AuthorId eq 5, or by a property likeAuthor/Title eq 'Sam'after adding the field to$expand. SelectingAuthor/Titlealso needs$expand=Author. - Yes/No fields filter as
eq 1oreq 0. - Over 5000 items: a query that is not covered by an index throws the list view threshold error. Filter or order on an indexed column, keep
$topat or below the page size, and follow theodata.nextLink(the__nextURL) for the next page.$skipis not honoured on list items, though it works on lists, fields, users and groups. - In PowerShell and cURL the
$in$selectmust stay literal, so this tool single-quotes those strings for you.