web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Count Unique records i...
Power Apps
Unanswered

Count Unique records in a column with Model-driven app

(1) ShareShare
ReportReport
Posted on by

Hey all,

 

I have a model-driven app using Dataverse and am trying to count all the unique records in a column, but don't seem to be able to.

 

I'm looking or something similar to 'select count(Distinct(columnName)) from tableName' like in SQL.

 

Tried creating a Canvas Page with the distinct function, but it definitely does not count all records - probably some delegation issue without actually displaying any error.

 

Thanks

I have the same question (0)
  • meelamri Profile Picture
    468 on at
  • Community Power Platform Member Profile Picture
    on at

    Thanks @melamri for getting back to me. I tried your suggestions, unfortunately I can't use the 'HTTP with Azure AD connector' due to DLP policies that block it. A custom connector is again out of the question for the exact same reason. Tried the Premium HTTP connector, but then again, can't authenticate...

     

    I'm a bit stumped as I really did not expect such a common scenario to take so much effort, and it's not even resolved!

     

    Your suggestion even gave me the idea to try and use an OData filter to get distinct values, but again, the 'List Rows' connector had no idea what to make of it (no wonder, $apply is not in the list of supported query options for Dynamics 365: docs.microsoft.com/en-us/dynamics365/fin-ops-core/..)

    $apply=groupby((ColumnName))

     

    Any other ideas?

  • v-xiaochen-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    Maybe power automate can do this.

    vxiaochenmsft_0-1654585503672.png

     

    vxiaochenmsft_1-1654585510736.png

     

    vxiaochenmsft_2-1654585526942.png

     

    Best Regards,

    Wearsky

  • meelamri Profile Picture
    468 on at

    Hi @Anonymous 

     

    I understand that you can't use the HTTP with Azure AD connector. For this reason, I had shared two approaches.

    The second one uses the dataverse connector, but you have to implement a custom api on dataverse to execute your fetchXml. Have you been able to check this option?

    I refer to the following blog: https://xrmtricks.com/2022/03/16/power-automate-dataverse-how-to-execute-a-fetchxml-query-that-includes-options-not-supported-by-the-list-rows-action/

     

     

    Please tick Accept as solution if the answer is useful.

    https://xrmtricks.com/

     

     

     

  • Community Power Platform Member Profile Picture
    on at

    Thanks @melamri. I did read your article, which does look elegant, but I'm afraid you lost me at creating a custom api..  I looked at Tutorial: Write and register a plug-in (Microsoft Dataverse) - Power Apps | Microsoft Docs, but unfortunately, I can't download any apps onto my device and can only access the Power Platform from the work device to register it. Is there a way I can build the plugin on my personal device and register the plugin somehow without the registration tool? Or PowerShell, or any admin access to Azure, none of which I have unfortunately... Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard