2 Best Ways to Quickly Count Items in SharePoint List Using Power Automate

I was working on an IT Help Desk application when I encountered an interesting challenge.

We were using Power Automate to fetch data from a SharePoint list and display it in a Power App. In our case, we wanted to show the total ticket count directly in the app.

At that point, our SharePoint list already had over 7,000 records, and I needed a quick way to determine how many items were present.

I then test both approaches using the Get Items action and the SharePoint REST API to determine which one provides the count more quickly and efficiently.

In this tutorial, I’ll show you how to quickly count items in any SharePoint list or document library using Power Automate, and also compare the performance of both methods so you can choose the best one for your scenario.

Count Items in SharePoint List/Library Using Power Automate

For this example, I created a sharepoint list which contains 11152 records.

Count Items in Any SharePoint List in Power Automate

Method 1: Using the Get items Action

  1. Go to Power Automate and create an Instant Cloud Flow. Choose Manually trigger a flow (for testing).
  2. Search for Get items (SharePoint). Then select your Site Address and List Name.
Power Automate flow counting items in a SharePoint list automatically
  1. Add a Compose action and enter this expression:
length(body('Get_items')?['value'])
Power Automate to count SharePoint library items

Save and run the flow. Then you’ll notice that the Get items action only retrieves 100 items by default, even though the list actually contains 11,152 records.

That’s because the default item limit for the Get items action in Power Automate is 100 items.

Power Automate example flow calculating total list items

To get more, you’ll need to enable Pagination. To do this, follow the steps:

  1. Click on the Get items action.
  2. Go to the top-right corner and select Settings.
  3. Turn on the Pagination option.
  4. Set the Threshold limit to a higher value, for example, 20000.
Count SharePoint List Items Power Automate

Save and run the flow again.

Now, you’ll get all 11152 records, and the Compose output will correctly show 11152.

How to Count SharePoint List Items using Power Automate

However, as you’ll notice, this approach takes more time to execute because it retrieves every single record to count them.

That’s why I tried a faster method using the SharePoint REST API.

Method 2: Using the SharePoint REST API

  1. Go to Power Automate and create an Instant Cloud Flow. Choose Manually trigger a flow.
  2. Then add a Send an HTTP request to SharePoint action from sharePoint Connector with the below parameter:
_api/web/lists/getbytitle('Your List Name')/ItemCount
How to Get Count of Items in SharePoint List in Power Automate
  1. Add a Compose action and use the expression below to extract the item count:
body('Send_an_HTTP_request_to_SharePoint')?['d']?['ItemCount']
Power Automate Flow to count items in a SharePoint List

Save and run the flow. This time, you will quickly get the total item count even if your list has over 10,000 records without loading all the data.

Quickly Count Items in Any SharePoint List or Library Using Power Automate

Now you know that using the REST API is the fastest way to get the total item count in Power Automate. But keep in mind, this method only returns the count.

If you need to retrieve actual item data along with specific columns, check out my tutorial on Get All SharePoint List Items using REST API Pagination in Power Automate.

I hope you found this article helpful.

You may also like the following Power Automate tutorials:

Power Apps functions free pdf

30 Power Apps Functions

This free guide walks you through the 30 most-used Power Apps functions with real business examples, exact syntax, and results you can see.

Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App