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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / filter unique column v...
Power Automate
Unanswered

filter unique column values from dataverse table

(0) ShareShare
ReportReport
Posted on by
Hi All,
I have a dataverse table which is having 200K + records . Basically it is having connection details for all environment in my tenant . There is a column named as Environment which store EnvironmentId against each connection so there are duplicates in this column. I want to get unique EnvironmentIds using powerautome which are there in the Environment column so that I can process on them further in the flow.
I have tried 'List Rows' action but there is no option to filter rows based on unique value in a column.
If I go with union function to apply on array with Environmentid returned in List Rows action then I would have to retrieve 200K+ records using skip token which would take ample amount of time I believe.
Please suggest what best I can do in this case .
Thanks in advance.
Categories:
  • Linn Zaw Win Profile Picture
    2,996 on at
    <fetch aggregate='true'>
     <entity name='xyz_connectiondetails'>
     <attribute name='xyz_environmentid' alias='environmentid' groupby='true' />
     </entity>
    </fetch>

     

    You can query using the Fetch Xml Query in your List Rows action with Aggregate property and Group By EnvironmentId to get the unique EnvironmentId. (as the example above)

  • Meshare Profile Picture
    on at

    @LinnZawWin , I have tried the fetch xml you have provided but got below error:

     

    "AggregateQueryRecordLimit exceeded. Cannot perform this operation." 

  • Linn Zaw Win Profile Picture
    2,996 on at

    My bad... 🙁

    Queries that return aggregate values are limited to 50,000 records.

    https://learn.microsoft.com/power-apps/developer/data-platform/use-fetchxml-aggregation?WT.mc_id=DX-MVP-5003873#limitations

     

    For your 200K+ records, I guess retrieving multiple pages using the skip token might be the only option.

     

    Alternatively, you can create a new Environment table, create a lookup to Environment in the connection details table and auto-populate based on the EnvironmentId (with another automated flow which retrieves the existing based on EnvironmentId and creates one if there is none).

    In that way, you have a unique list of EnvironmentId in the Environment table.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 298 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 289

#3
Henil Profile Picture

Henil 125

Last 30 days Overall leaderboard