SPO-ASSIST

How to Build an OData Query for SharePoint Online

The SharePoint Online REST API uses OData query parameters to filter, sort, and shape the data it returns. The syntax is powerful but easy to get wrong, especially with lookup fields and date filters.

The core parameters

A working example

To get the title and author of active items, newest first:

https://yourtenant.sharepoint.com/sites/yoursite/_api/web/lists/getbytitle('YourList')/items?$select=Title,Author/Title&$expand=Author&$filter=Status eq 'Active'&$orderby=Created desc&$top=50

Common mistakes

Testing queries safely

Always test with $top=1 first before running a broader query, especially against large lists — a malformed $filter against a list with list view threshold issues can time out or return unhelpful errors that don't point at the actual syntax problem.

Building queries visually

Getting the syntax right — especially combining $expand and $select on lookup fields — is the most common source of trial and error. SPO-Assist's OData query builder lets you construct the query visually against the list you're actually viewing, so you can see field internal names and build valid $filter/$select/$expand combinations without memorizing the syntax.