How to get number of items in a SharePoint list using Power Automate?
+
SharePoint Online lists often manage key data like project tasks or support tickets. For example, a project management team needs to quickly assess the number of open tasks to prioritize workloads and meet deadlines. Automating the tracking of list items with Power Automate helps ensure timely and accurate updates, eliminating the need for manual monitoring.
To automate the process of counting the number of rows in a SharePoint list using Power Automate, follow these steps:
- Sign in to the Power Automate and create a new Scheduled cloud flow. Set a name for the flow and specify the desired frequency for how often you want it to run.
- Add the Send an HTTP request to SharePoint action. Configure it with your SharePoint site URL and use the following Uri endpoint to get the item count from your list:
/_api/web/lists/getbytitle('<ListTitle>')/ItemCount
- Add a Compose action to extract the item count from the HTTP request response using the provided expression.
body('Send_an_HTTP_request_to_SharePoint')?['d/ItemCount']
- Add the Initialize variable action to create a variable. Set its type to Integer and give it an appropriate name.
- Add the Set variable action to assign the item count obtained from the "Compose" action to your initialized variable.
- Add the Send an email (V2) action to notify yourself or others. Include the variable output in the email body or subject. Finally, save and test the flow to ensure it operates correctly.
For a clear visual representation of the flow, please refer to the GIF provided below.