Hey all - I'm trying to do a really simple flow to just count the number of records in a Dataverse table - all I'm doing is this
length(outputs('List_rows')?['body/value'])
Problem is it gives me the wrong number -I get 5000 and I know for a fact there are 15000 in the table. What am I missing?
Thx
@abm Agreed - using the Rest API is probably a better solution here to get the item count. I'd probably do some testing though as using ItemCount in PowerShell sometimes doesn't give the exact count as it's cached. Not sure if the same in Power Automate and the Rest API.
Thanks for your reply. My understanding is if you have large data sets to process then setting the pagination always helps. Batch by batch you can deal with the data rather than one is whole go in terms of memory and other resources.
If I want to use the total count for the records I would use the REST API way which I explained earlier in my post.
Thanks again.
@abm I didn't quite say the correct thing in my previous post. List rows (Dataverse) and Get items (SharePoint) both retrieve the first 100 items by default (if left blank). You can increase this up to 5000 using Top Count.
If you then turn on Pagination, it will start to return your items in batches of what you've set for Top Count, up to the Threshold you specified. Some examples below.
Example 1:
Settings:
Result:
Example 2:
Settings:
Result:
Example 3:
Settings:
Result:
Example 4:
Settings:
Result:
Note 1: If you're potentially going to receive more than 5000 items, you should set your Top Count to 5000 (max batch size) and turn on Pagination.
Note 2: List rows present in a table (Excel) has a default of 256 items returned. Same conditions as above apply here too, except 256 if Top Count is blank instead of 100.
Thanks for answering @grantjenkins
Interesting question and I tested this with 6000 records. Get Items action step with no threshold returned me 100 records. I set the pagination to 10,000 and it returned me 6000 records as records count.
The above documentation says 5000 is the limit for the filter query. I did tested with a filter query Id greater than 0 and it did returned me 6000 with the threshold settings to 10,000. Without threshold it did returned 100.
A bit confused about 5000 limit here? Do I need more records to test this @grantjenkins ?
For finding only the total record count I did used the REST API query and it did returned 6000 record count.
@grantjenkins - ugh... so simple!! thank you! perfect
By default, List rows will only return the first 5000 items. You'll need to go into the Settings of the action, turn on Pagination and set a Threshold larger than the number of items in your table. This will return the items in batches of 5000 up to the Threshold you have set.
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492