Get count of unique records in Power Automate (Dynamics Customer Engagement)

Recently, I got a requirement in which I had to get the distinct count of records(from a custom table) associated with Appointment. To achieve this I wanted to go with the flow but since I recently have started working on Flow/ Power Automate, I had very little idea how to achieve this and hence I am adding the steps here which you can also follow to get this.


Step 1: Choose the trigger point



Step 2: Get the list of records for which you want count of distinct value




Step 3: Initialize a variable of type array 




Step 4: Add action 'Apply to each', here I am adding all Guids in array which we declared in last step


Step 5: Add a 'Compose' data operation, here we will add only unique Guids from the above list collected:

union(variables('AccountsArray'),variables('AccountsArray'))



Step 6: In the final step we just need to count the records of unique Guids stored in the last step.

length(outputs('Compose'))

 



Combined screenshot fyr:




Comments

Popular posts from this blog

Search data in Gridview on Textbox Key press event using JQuery in Asp.Net- C#

StateCode and StatusCode Values for mostly used entities in Microsoft Dynamics CRM 2013

Dumps for Microsoft Dynamics CRM MB2-703 Practice Exam Questions Free

How to import CSV files into DataTable in C#

How to show enlarge image when mouse hover on image or link in Asp.Net(c#) using JavaScript

go to top image