To count rows from a Dataverse table using Power Automate, we can use the Power Automate Length() function.
The Length function allows you to quickly count the number of rows in a Dataverse table, making it easy to get the total number of records.
In this tutorial, I will show you how to use the Length function to count rows from a Dataverse table in Power Automate and demonstrate how to count filtered rows in a Dataverse table using Power Automate.
Count Rows in Dataverse Table
Below is a Dataverse table, Employee Records, that contains the Employee ID, Name, Department, Position, and Hire Date.

I have nine rows in the Employee Records; we will create a flow and verify the row count.
- Go to Power Automate and create a new instant cloud flow by manually triggering a flow trigger.
- Then add a List rows action present under the Microsoft Dataverse and provide the below parameters:
- Table name: Select the Employee Records from the dropdown.

This action gets our Employee Records table rows in an array format.
- Then add compose action and provide the below expression to count the rows:
length(outputs('List_rows')?['body/value'])

- Then, save the flow and run it manually. Once the flow runs successfully, click the compose action, and then you can see the count of rows in the output section.

This way, we can count the rows from the Dataverse table using Power Automate.
Count Filtered Rows in Dataverse Table
Now, let’s say you want to count only specific rows based on a condition (for example, count only employees from the IT department).
We can still use the length function, but first, we need to apply a filter to the action of the list rows.
Follow the steps below:
- Go to the Power Automate site and create a new Instant cloud flow with the Manually trigger a flow trigger.
- Add a List rows action from the Microsoft Dataverse connector. Provide the following parameters:
- Table name: Select Employee Records from the dropdown.
- Filter rows: Enter a filter expression. This should be a valid OData filter that matches your condition.
cr0e5_department eq 'IT'

- Add a Compose action. In the Inputs field, use the following expression to count the filtered rows:
length(outputs('List_rows')?['body/value'])

- Save the flow. Run it manually.
- After the flow runs successfully, click on the Compose action. In the output section, you will see the count of only the filtered rows (for example, how many employees are from the IT department).

This way, by using the Filter rows option in the List rows action along with the Length function, you can easily count only the filtered rows from a Dataverse table using Power Automate.
Other Dataverse articles you may also like:
- Check If SharePoint List Column Equals in Power Automate
- Create SharePoint List View Using REST API
- Get Dataverse Created by in Power Automate
- Remove Commas From Dataverse Number Field
- Update a Row in Dataverse Using Power Automate

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.