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 / Don’t allow the same u...
Power Apps
Answered

Don’t allow the same user in different datacard

(0) ShareShare
ReportReport
Posted on by

Hello! 

i’m building an app based on a sharpening list, and 3 columns are names from users of my company. In the power apps, I created an editform to allow changes in these columns, but I want to put a restriction that don’t allow the same person/user in more than one column. I can’t find ways to do this efficiently. 
can you help me please? 

PNG image.png
Categories:
I have the same question (0)
  • Al_10 Profile Picture
    1,691 Super User 2024 Season 1 on at

    @araujocamila 

     

    your SP columns are single select Person columns?
    if yes:

     

    Combobox1.OnChange = 

    If( Self.Selected.Email = ComboBox2.Selected.Email || Self.Selected.Email = ComboBox3.Selected.Email, Reset(Self) )

     

    Combobox2.OnChange = 

    If( Self.Selected.Email = ComboBox1.Selected.Email || Self.Selected.Email = ComboBox3.Selected.Email, Reset(Self) )

     

    Combobox3.OnChange = 

    If( Self.Selected.Email = ComboBox2.Selected.Email || Self.Selected.Email = ComboBox1.Selected.Email, Reset(Self) )

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @araujocamila

    Have you solved your problem?

    Do you want to ensure that there are no duplicate users in a record?

    Could you please share a bit more about the scenario, do you have a People picker to select user name?

     

    Not sure why there is a button for each Combo Box, but I think if you only have one submit button, you could achieve your need by setting the OnSelect property of the submit button as below:

    If(
     ComboBox1.Selected.Email = ComboBox2.Selected.Email || 
     ComboBox1.Selected.Email = ComboBox3.Selected.Email || 
     ComboBox2.Selected.Email = ComboBox3.Selected.Email, 
     Notify("Please select different user!",Error)
    )
    

     

    Or I think you could consider the ErrorMessage control, set the Text of the Label corresponding to the ErrorMessage in your data card as below:

    "Please select different user!"

    Set the Visible of the ErrorMessage as below:

    If(
     ThisItem.columnA = ThisItem.columnB || 
     ThisItem.columnA = ThisItem.columnC || 
     ThisItem.columnB = ThisItem.columnC
    ),true,false)

    Please write the above formula for each ErrorMessage Label.

    And for the OnSelect property of the submit button as below:

    If(
     ErrorMessage27.Visible || ErrorMessage23.Visible || ErrorMessage24.Visible,
     Notify(
     "User exists, please note the error message!",
     NotificationType.Warning
     ),
     SubmitForm(EditForm1)
    )

     

    Hope this could help you at some degree.

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 96 Super User 2026 Season 1

Last 30 days Overall leaderboard