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 / SQl Get Rows (V2) Uniq...
Power Automate
Answered

SQl Get Rows (V2) Unique values

(0) ShareShare
ReportReport
Posted on by 34

Im struggling with getting only unique values from the SQL Get Rows(V2) output. Has anyone been able to figure it out?

Categories:
I have the same question (0)
  • 365-Assist Profile Picture
    2,327 Moderator on at

    Perhaps you should use the Get Row Action instead

     

    Annotation 2019-10-18 114234.jpg

  • v-litu-msft Profile Picture
    Microsoft Employee on at

    Hi @NazIM,

     

    I found that you have reply a post to a similar question, does that method not work?

    https://powerusers.microsoft.com/t5/General-Flow-Discussion/Array-variables-unique-values/m-p/385325#M32576

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • NazIM Profile Picture
    34 on at

    Unfortunately not. Get Row does not work with On Premise Data Gateways.

  • NazIM Profile Picture
    34 on at

    Did try it, but it does not seem to work.

  • 365-Assist Profile Picture
    2,327 Moderator on at

    Hi Nazi,

     

    My example of Flow with Get Row is connected via an On-Premises Data Gatway to an SQL Database. What error do you get when you try it?

     

  • NazIM Profile Picture
    34 on at

    Just tried again. Get Row (V2) works. I believe the earlier version wasn't.

     

    I guess my issue is different though. What I want is the equivalent of "SELECT DISTINCT <Col> .." in SQL (i.e.: Only unique values / no repeats of the same value).

  • Barret Profile Picture
    652 Most Valuable Professional on at

    You might try using the "Execute a SQL Query (V2)" action and pass in an actual SELECT DISTINCT query. That's generally the route I take when I need get distinct data.

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hey @NazIM 

     

    In case you do not plan to go an alternate way of performing the sql query, you can use the below method to identify the unique values by creating arrays: 

    https://powerusers.microsoft.com/t5/Microsoft-Flow-Community-Blog/Delete-duplicate-records-items-from-Dynamics-365-CRM-CDS/ba-p/334853

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • NazIM Profile Picture
    34 on at

    @ : That's not supported with On-Premise Data Gateway:

     

    image.png

     

  • Verified answer
    NazIM Profile Picture
    34 on at

    @yashag2255, Didn't try the method shown in the link. 

     

    However, what I succeeded with doing is:

    1. Get rows (V2) to run the query.

    2. put all the field values into an array usig a ForEach action.

    3. Used a Union function in a Compose action to union the array with itself

    4. Used a join function to create a string from the array.

     

     

    image.png

     

    Very convoluted, but its the only way I got it to work! Phew!!

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 247 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 164 Super User 2026 Season 2

#3
trice602 Profile Picture

trice602 138 Super User 2026 Season 2

Last 30 days Overall leaderboard