cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ChadVKealey
Level 10

People picker - BLOCK current user

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).

1 ACCEPTED SOLUTION

Accepted Solutions
ChadVKealey
Level 10

Re: People picker - BLOCK current user

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.

View solution in original post

2 REPLIES 2
Dual Super User
Dual Super User

Re: People picker - BLOCK current user

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

ChadVKealey
Level 10

Re: People picker - BLOCK current user

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.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 197 members 5,331 guests
Please welcome our newest community members: