This Microsoft Dataverse tutorial will discuss how to get dataverse list rows count using Power Automate.
I recently worked on a Dataverse Project where I wanted to use Microsoft Flow to determine the number of Dataverse records.
Using a simple scenario, I’ll demonstrate how to utilize Power Automate to find the dataverse list rows count.
Also Read: How to get data from Dataverse in Power Apps
Get Dataverse List Rows Count Using Power Automate
It is occasionally necessary to determine the total number of records in a table while working with a list of records for a particular thing in order to execute specific manipulations.
Here, you can utilize Power Automate’s length function to find the number of records in a given list.
To get all the dataverse list rows count using Microsoft flow, we can follow the instructions below:
- A Dataverse table called Car Details is visible in the screenshot that follows. As you can see, certain columns include various types of data. Additionally, this table contains the following 11 records.
- I now want to use Power Automate to count all the rows in these dataverse tables.
- First, using the URL make.powerapps.com, sign in to the power Apps environment by entering your login and password. Go to the Flows (from the left menu) -> Click on the + New flow -> Choose Instant cloud flow under the Build your own from blank section.
- Also, you can create a new flow by using make.powerautomate.com (Microsoft Flow login page) directly.
- Next, provide a unique flow name (Car Info Count) and choose how to trigger the flow (where I have chosen Manually trigger a flow). Click on Create.
- The flow will appear as seen in the screenshot below once it has been established. To add a new action, click the + New step button after that.
- Search List rows in the search bar and select the List rows (PREMIUM) action under the Microsoft Dataverse section as shown below.
- Just rename the action once the List rows action has been added to the flow (List rows – Get Car Details). Provide the input below:
- Table name = Expand the down arrow and select your standard or custom table (Car Details).
- To add an initialize variable action, click the + New step button after that. Initialize variable can be found under the Variable section by searching Variable in the search field.
- Once the variable has been added to the flow, simply rename the action (Initialize variable – Get Car Count). Provide the input below:
- Name = Provide a name to the variable action.
- Type = Select the variable type as Integer from the dropdown menu.
- Value = For the value field, we need to apply the formula below in the Expression tab.
- length = The length function in Power Automate returns the size of a string (number of characters) or an array (number of elements for an array).
- ‘List_rows_-_Get_Car_Details‘ = The list rows action is known by this name. The proper name must be enclosed in a single inverted comma including an underscore.
- Once the code is verified and everything is done, click on OK. The Update button is visible in the example below because the formula has already been applied to the Value field.
- That is all there is to do in Power Automate. The entire flow structure will resemble the illustration below. Now save and test the flow. Click on Save.
- Once you click on Save, a flow checker popup will appear where it displays the warning message below:
“Updating action ‘List rows – Get Car Details’ to use OData filter queries can improve the performance of your flow. Learn more: https://flow.microsoft.com/blog/advanced-flow-of-the-week-filtering-with-odata“.
- It states that an OData filter should be provided for the dataverse list. But since my goal is to count the records, I haven’t provided any filter.
- As soon as we dismiss the warning message, a successful message in the color green, i.e “Your flow is ready to go. We recommend you test it“.
- To test the flow, click on the top Test button -> Select Manually -> Test as below.
- After that, click the Run flow button below, and the successful window will show up where it says that “Your flow run successfully started. To monitor it, go to the Flow Runs Page“. Click on Done.
- Finally, the successful notice shows that the flow ran successfully. To view the output, expand Initialize variable – Get Car Count action and go to the Value field. From the specific dataverse table (Car Details), you can see that there are 11 records in total.
This is how you use the list action’s length function to quickly obtain the record count from the dataverse table.
Furthermore, you may like some more Dataverse tutorials:
- Power Apps Dataverse Yes/No Field
- Power Apps Dataverse Choices [Complete Guide]
- How To Get Row by ID From Dataverse Table
- Power Apps Different Home Screen Based On Different User
- How to Export Dataverse Table to Excel
- Power Apps Add Data to Dataverse Table
- How to create and use dataflow in Dataverse
- Dataverse Solution [Complete Tutorial]
- How to Create Dataverse File Field
- How to Upload images to Dataverse from Power Apps
- How to Create Dataverse View
In this Dataverse tutorial, we discussed how to get dataverse list rows count using Power Automate.
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com