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

Notifications

Announcements

No record found.

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,562 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,562 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans