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 Apps / Displaying Duplicate S...
Power Apps
Answered

Displaying Duplicate SQL Records

(0) ShareShare
ReportReport
Posted on by 209

Hi All.

I am losing my mind over this little problem that I am trying to work out.

I have a SQL DB table which looks like this:

PowerAppsFilter-NonDistinct.jpg

 

I am trying to create a gallery to list out the NCID which meet the following criteria:
a. EMAILSTATUS = NO

b. PONO are the same as other records

 

In effect, show the duplicated PONO. 
I have found lots of info on DISTINCT, etc, but unable to find a post showing how to actually show duplicated records in a SQL db.


Any advice/hints would be greatly appreciated.

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi @kevinsray ,

    This article may be of assistance.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • kevinsray Profile Picture
    209 on at

    Hi Warren,

    Thank you for this feedback.

    I have seen several of this type of check.

    However, this check is for to check that what you are entering does not already exist.

    So, not sure it works in the situation I am trying to create.

    I know there are duplicates, and I want to display them.

  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi Kevin @kevinsray ,

    That is actually easier (I thought you wanted to check the whole list). Assuming you have entered a PONO value in a text field CheckPOthis will return a Boolean value of true if there is already a matching record in YourList.

    If(
     IsBlank(
     LookUp(YourList,
     EMAILSTATUS = "NO" &&
     PONO = CheckPO.Text 
     ),
     false,
     true
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • kevinsray Profile Picture
    209 on at

    Hi Warren,

    Thanks again.
    I am not intending on putting a text input to check.
    I wanted to get the records with duplicated PONO to display in a gallery.

  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi Kevin,

    Sorry, I must have misunderstood your last post when you said that you were checking entries didn't already exist.

    If you are trying to check the whole list, I was experimenting with a collection before you responded. My theory was

    1. Do a collection of all the Distinct records
    2. Do a filtered collection of all the List item IDs that were not the the collection - they will be your duplicates.

    You would need under 2000 records to do this.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @kevinsray ,

    Do you want to show NCID records within a Gallery based on duplicate PONO field values?

     

    I have made a test on my side, please consider take a try with the following workaround:

    Set the Items property of the Gallery to following:

    Filter(
     RenameColumns('[dbo].[YourSQLTable]', "PONO", "PONO1"),
     EMAILSTATUS = "NO",
     CountRows(Filter('[dbo].[YourSQLTable]', PONO = PONO1)) > 1
    )

    Within the Gallery, add a Label, set the Text property to following:

    ThisItem.NCID

    Note: Please make sure you have set the "Data row limit for Non-delegable queries" option to maximum value -- 2000. 

     

    Best regards,

  • kevinsray Profile Picture
    209 on at

    Hi Kris,


    Wow. Thank you so much.
    Works beautifully. 
    I have so much more to learn about PowerApps..

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard