Announcements
Hi,
I am trying to implement Search using $search. I want to get the total record count upon each query. But in case if there are more than 5000 records, no matter what I do, I never get the total records requested. If I apply a filter that returns less than 5000 then I get the correct figure. But if the records are less then I get -1 because I cannot use $top with $count.
I cannot use the RetrieveTotalRecordCount function because that will return the count of ALL records of an entity.
Is there a way I can get a correct count of the records that are returned by the query.
Regards.
Adeel.
I am using REST API to query Dataverse
Hi Partner,
Yes. it is limited to 5,000 rows.
Maybe you can try to use other ways to get correct count when you query records with filter:
1.create one report for the entity.
Create a report using the report wizard, specify the criteria:
In the LayOut fields window, specify Count as the summary type for grouping.
Run the report to get the count.
2.use the FetchXMLBuilder plugin of the XrmToolBox to build the query , copy it.
Then use it in the FetchXML / View Record Counter.
Select the entity, contact, in this case, paste the FetchXML query and click Execute Count.
We will get the count.
You can refer the following link for more details:
How to – Different ways of getting record count (total) in Dynamics 365 – Nishant Rana's Weblog
use my tool Dataverse REST Builder to generate the query (Retrieve Multiple request type) and make sure you select Retrieve Count as Yes
after you can see how the query string and the headers are generated
Which of the Dynamics 365 products is this question about?
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156