search_records_by_odata
Query Dynamics 365/Dataverse records using OData filters, ordering, and bounded paging to get precise results and resume large result sets with continuation.
Instructions
Query records using OData with explicit state policy, stable ordering and bounded server-driven paging. Defaults to one page and legacy statecode=0 where valid; all adds no implicit state filter. Returns completeness and continuation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | Native query limit, independent of per-call max_records. Cannot be combined with page_size. | |
| expand | No | OData navigation expansion. Nested child collections are not independently auto-paged. | |
| filter | No | OData filter expression | |
| select | No | Comma-separated list of attributes to retrieve | |
| orderby | No | Comma-separated property paths with optional asc/desc. Primary key is appended as a tie-breaker where available. | |
| fetch_all | No | Follow server paging up to max_records/max_pages. Default false returns one page. | |
| max_pages | No | Maximum server pages read per call, default 10, when fetch_all=true. | |
| page_size | No | Requested server page size, default 500. Cannot be combined with top. FetchXML count is preserved unless the same value is supplied. | |
| state_mode | No | legacy preserves valid implicit statecode=0 filtering; all adds no state filter; values uses state_values validated against this table. | |
| max_records | No | Maximum records returned in this call, default 5000. Remaining records can be resumed with continuation. | |
| continuation | No | Opaque cursor from a previous result; valid for five minutes in this server connection. Resumes saved query and buffered records. | |
| state_values | No | Explicit numeric state values; requires state_mode=values. | |
| collection_name | Yes | EntitySetName (Web API collection name), e.g. accounts; use table metadata rather than guessing a plural name. | |
| formatted_values | No | Include formatted labels and display values returned by CRM. |