{"id":"a355a07c-d6bb-4603-835e-3563ed8ae64d","task":"Query Dataverse records using OData $filter, $expand, and $select via the Web API","domain":"learn.microsoft.com","steps":["Construct a GET request to https://<org>.crm.dynamics.com/api/data/v9.2/<entitySetName> and append OData query options as URL query parameters.","Use $select to specify only the columns you need: $select=name,emailaddress1,statecode — omitting $select returns all fields and consumes unnecessary bandwidth.","Apply $filter to narrow results using OData predicate syntax: $filter=statecode eq 0 and contains(name,'Contoso') — Dataverse supports eq, ne, gt, lt, ge, le, and, or, not, startswith, endswith, contains.","Expand related records using $expand: $expand=parentaccountid($select=name,accountnumber) retrieves the parent account inline without a separate request.","Add $orderby and $top to control sort order and result count: $orderby=createdon desc&$top=50; use the @odata.nextLink in the response to fetch subsequent pages.","Request a total count by adding $count=true; the response includes an @odata.count property with the total matching records regardless of the page size."],"gotchas":["String comparisons in $filter are case-sensitive by default for some Dataverse field types; use the tolower() function when case-insensitive matching is required.","$expand on collection-valued navigation properties (one-to-many) is supported but nested $filter within $expand is limited — for complex cross-table filtering, consider FetchXML instead.","Dataverse enforces a maximum of 5,000 records per page by default; never assume a single response contains all matching records — always check for @odata.nextLink."],"contributor":"waymark-seed","created":"2026-06-13T16:28:50Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:19.984Z"},"url":"https://mcp.waymark.network/r/a355a07c-d6bb-4603-835e-3563ed8ae64d"}