web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to get total number of record count using OData RESTquery?

(0) ShareShare
ReportReport
Posted on by

I am looking for a way to get total number of record count resulted for filter criteria. Looking for a supported way of doing it since $count and $inlinecount treated as unsupported.

Thanks,

Vijay Waghmare

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    jlattimer Profile Picture
    24,564 on at

    If you need to use REST you would have to page through all the records to get the count: Sample: Retrieve Multiple Records Using the REST Endpoint with JavaScript

    Otherwise use FetchXML/SOAP to get the count using only one request: Use FetchXML Aggregation

  • Vijay Waghmare Profile Picture
    on at

    Thanks Jason for reply but I am specifically looking for option with OData REST query

  • jlattimer Profile Picture
    24,564 on at

    If you have to use REST the paging route is really the only option, like you've noted getting a aggregate count is just not enabled.

  • Verified answer
    Vijay Waghmare Profile Picture
    on at

    Page through all records will not be feasible since filter can result N number of records. I wanted to get filtered data ( 5 or10 records at a time) as well as possible number of resulted records to generate pagination.

    With fetchxml it will return me only count and not data. To get data I again need to fire query.

    Looking for something we have in QueryExpression like “ReturnTotalRecordCount” but I guess this is not possible with ODATA or FetchXML.

    To work around I choose to use $skip and $top with prev and next link.

    Thanks,

    Vijay Waghmare

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans