web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / People picker - BLOCK ...
Power Apps
Answered

People picker - BLOCK current user

(0) ShareShare
ReportReport
Posted on by 1,393

I have a form that students fill out to propose extra credit projects. Their proposal is routed to the "Instructor", which they specify in the form (in a people picker field; the data lives in SharePoint). We recently had a couple of students enter themselves as the Instructor and approve their own projects. Not good. 

 

It would be perfect if there were a way to only allow them to select people who have a manager listed (all instructors have a manager; students do not), but at a minimum, I need to prevent them from entering themselves as the Instructor.

 

I've tried setting a Rule, using "Instructor.Selected.Email = User().Email" as the condition and making a warning dialog visible as the Action, but that didn't work (the dialog never appeared and the combo box/people picker broke to the point I couldn't select a user in it).

Categories:
I have the same question (0)
  • RezaDorrani Profile Picture
    12,143 on at

    Hi @ChadVKealey 

     

    Instructor.Selected.Email = User().Email should work

     

    add 2 labels on screen (for testing purpose only)

     

    label 1 text set to Instructor.Selected.Email

    label 2 text set to User().Email

     

    see if they match

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • Verified answer
    ChadVKealey Profile Picture
    1,393 on at

    Actually, I knew that Instructor.Selected.Email = User().Email would work for the matching part of it. What I had trouble with was using the result to provide appropriate feedback to the user. What I ended up doing was incorporating that match into the formula already controlling the displaymode of the save/submit button in the App. That button is disabled until all of the required fields have values and the selected instructor is NOT the current user. Not an ideal solution, but it does work.

  • Tanwar0326 Profile Picture
    2 on at

    I have a similar issue.  But mine is on the SharePoint list form and not in the Power app.  I have a SharePoint list form where users request an item.  User also have option to chooose a supervisor for an approval from a supervisor people picker field.  They can choose anyone but themselves as supervisor and how do i do that?  Thank you in advance. 

  • PronobPaul1989 Profile Picture
    3 on at

    Navigate to People Picker control, go to  `Advanced` properties,  find the `OnChange` property.

     

    Onchange property, try if statement.for ex:

    If(
    PeoplePicker.Selected.Email = User().Email,
    Notify("Notification message for Approver.", NotificationType.Error);
    Reset(ThisItem.FieldName)
    )

  • NEhaTripathi Profile Picture
    6 on at

    This solution works.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard