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 / How do I check if item...
Power Apps
Unanswered

How do I check if item exists in multiple columns (SharePoint List) before SubmitForm?

(0) ShareShare
ReportReport
Posted on by 96

How do I make sure I have all unique values in 5 columns before submitting the new or editing the existing form? I have 5 columns that contain serial numbers. When checking on SP list, I see that I can only enforce unique values for each column. What would be the best option for me?

 

Thanks.

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @WhatisPowerApps 

    Stack all 5 columns in a single column

     

    ClearCollect(
     myCollection,
     RenameColumns(your_datasource_name.Column1,"Column1","ColumnA"),
     RenameColumns(your_datasource_name.Column2,"Column2","ColumnA"),
     RenameColumns(your_datasource_name.Column3,"Column3","ColumnA"),
     RenameColumns(your_datasource_name.Column4,"Column4","ColumnA"),
     RenameColumns(your_datasource_name.Column5,"Column5","ColumnA")
    );

     

    Then you can check if the unique values equals the count of totals rows

     

    CountRows(Filter(your_datasource_name, IsBlank(ColumnA)=false)) = CountRows(Distinct(Filter(your_datasource_name, IsBlank(ColumnA)=false), ColumnA))

     

    I took part of this answer from the Collections Cookbook.  You might want to take a look at it for some inspiration

    🙂

    Link To Collections CookBook App:

    https://powerusers.microsoft.com/t5/Community-App-Samples/Collections-Cookbook-50-Visual-Examples-amp-Code/td-p/437594

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • WhatisPowerApps Profile Picture
    96 on at

    Thanks for the quick reply. 

     

    I'm getting a delegating warning for CountRows. It says "CountRows operation is not supported by this connector." Anything I can do to get it fixed?

     

  • mdevaney Profile Picture
    29,991 Moderator on at

    @WhatisPowerApps 

    I know CountRows cannot be delegated but that error message is super wierd.  Please take a screenshot and post it.  Make sure to capture the formula and the error message.

     

    Also, please ensure your delegation row limit is increased to 2,000 in advanced settings.

  • WhatisPowerApps Profile Picture
    96 on at

    delegation errordelegation error

    Also, it's not catching the duplicate values. What am I doing wrong? I don't even have more than 10 rows at the moment. It's already set to 2000 limit.

  • WhatisPowerApps Profile Picture
    96 on at

    barcode1.JPG

  • mdevaney Profile Picture
    29,991 Moderator on at

    @WhatisPowerApps 

    The blank rows are going to impact the solution.  I did not anything to be blank.

     

    See my original post for my revised solution.  Here's what I would use to compare the row count instead.

    CountRows(Filter(your_datasource_name, IsBlank(ColumnA)=false)) = CountRows(Distinct(Filter(your_datasource_name, IsBlank(ColumnA)=false), ColumnA))

     

    You can ignore the delegation warning.  It will still come up even if there are less rows than the limit.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

  • WhatisPowerApps Profile Picture
    96 on at

    @mdevaney 

    Could you check your function? I think something wrong with it.

  • mdevaney Profile Picture
    29,991 Moderator on at
    @WhatisPowerApps
    Can you explain what is going wrong?
  • WhatisPowerApps Profile Picture
    96 on at

    @mdevaney 
    I don't get the second part of your code. I have 5 unique DataCardValue from the Form.  How do I compare them with the collection? This following code of yours is comparing datasource vs datasource. Am I missing something? Sorry, my brain is not working from trying to solve this one task for hours. lol

     

    CountRows(Filter(your_datasource_name, IsBlank(ColumnA)=false)) = CountRows(Distinct(Filter(your_datasource_name, IsBlank(ColumnA)=false), ColumnA))

     

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 396 Most Valuable Professional

#2
11manish Profile Picture

11manish 134 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 101 Super User 2026 Season 2

Last 30 days Overall leaderboard