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 / Enforce unique values ...
Power Apps
Unanswered

Enforce unique values in a SharePoint online list custom form

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a SharePoint Online list that has a text column "Job #" that is set to require unique values. I have customized the form using PowerApps and now I am not getting an error message when entering a Job # that is not unique. When trying to save a record with a duplicate Job # value it initially looks like it's trying to save then does nothing, if I click Save again I see a small flag appear in the top left corner that says "Skip to main content" which looks like a link but does nothing if I click on it.  I'm wondering if I did something wrong when customizing the form that caused the error message to not display like it did before customizing. Is there a way to get this working again?

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Melissa, 

     

    Assuming that

    1. you are using a Sharepoint list called sp_YourList

    2. You are using patch to patch the record

    3. The item of your form is set to varYourRecord

     

    You then need to enter in some code to display success or error based on the status of your Share point this. 

     

    Try this.

     

    Patch(sp_YourList, varYourRecord, YourForm.Updates);
    
    If(IsEmpty(Errors(sp_YourList)),
     // If no errors
     Notify("Success", NotificationType.Success); 
     Navigate(Screen_Main),
    
     //If we have errors 
     Notify(First(Errors(sp_YourList)).Message, NotificationType.Error)
    );

     

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi David,

     

    I am not using patching. All I did was create the list in SharePoint, added "Enforce Unique Values" to the field in question, and then customized the New form using Power Apps. Before customizing the form if you entered a value in the field that had already been used in the list it would give you an error message, but after customizing the form it behaves as I described above.

  • jaina Profile Picture
    517 on at

    @Anonymous  hello have you resolved this? I am getting the same issue.

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 Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard