cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dan_Ryan_
Regular Visitor

Match email in table to set displaymode

Hi,

 

After much searching on here and on you tube, I thought I'd best ask a question as I wasn't able to find the solution.

 

I'd like to change the DisplayMode on a button from Disabled, to View, but only if the User().Email is contained within a table of users; essentially what I'm trying to do is lock down some 'approval' buttons so that they only appear if the current user is held in a table.

 

So I've tried setting the DisplayMode formula to be if(LookUp(User_table, Email = User().Email) <> "", Displaymode.View, DisplayMode.edit)

However, this doesn't appear to work, so I was hoping one of you smart folk would be able to steer me in the right direction.

 

Thanks in advance,

Dan

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

Hi Dan,

I would try the following formula to see if that works better.

If(LookUp(User_table, Email = User().Email).Email <> "", 
   DisplayMode.View, 
   DisplayMode.Edit
)

If not, I would add a label and set the text property to this:

LookUp(User_table, Email = User().Email).Email

You can then use the result to debug/diagnose the result of the condition.

 

View solution in original post

2 REPLIES 2
timl
Super User
Super User

Hi Dan,

I would try the following formula to see if that works better.

If(LookUp(User_table, Email = User().Email).Email <> "", 
   DisplayMode.View, 
   DisplayMode.Edit
)

If not, I would add a label and set the text property to this:

LookUp(User_table, Email = User().Email).Email

You can then use the result to debug/diagnose the result of the condition.

 

View solution in original post

Dan_Ryan_
Regular Visitor

Fantastic! That worked. Thank you for your help. The tip on a using label to check the output is great too!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,070)