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.

2 REPLIES 2
Super User
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.

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

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