cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MIA99s
Frequent Visitor

Set button display using Lookup in SharePoint List

It is possible for me to use lookUp on SharePoint List (for list of user email) for make my button edit and disable under "DisplayMode"?

My SharePoint List have several user email, and I want to make my button can clickable base on email user under SharePoint List that I create.

Im using this code on button and "DisplayMode" but not working for me.

 

Here my details:

List: AdminAccess
Column: Title (which is I store straff email)
Code on button "DisplayMode": !IsBlank(LookUp(AdminAccess, Title = varUserEmail.Mail).Title)

1 ACCEPTED SOLUTION

Accepted Solutions

It should work, but you're missing a boolean operator after your Or statement (||)

 

I'm assuming you meant to post it like this: 

 

If(!IsBlank(LookUp(AdminAccess, Title = varUserEmail.Mail).Title) || !IsBlank(LookUp(StaffAccess, Title = varUserEmail.Mail).Title), DisplayMode.Edit, DisplayMode.Disabled)

View solution in original post

5 REPLIES 5
Aapok
Resolver II
Resolver II

Assuming your SP lookup works correctly, you're just missing setting the display mode.

 

You can try changing the code to: 

 

If(!IsBlank(LookUp(AdminAccess, Title = varUserEmail.Mail).Title), DisplayMode.Edit, DisplayMode.Disabled)

 

If above doesn't work, the problem is in your LookUp function.

phipps0218
Super User
Super User

@MIA99s you are close, try this:

If(!IsBlank(LookUp(AdminAccess, Title = varUserEmail.Mail).Title), DisplayMode.Edit, DisplayMode.Disabled)

 

Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful because this can help others.

LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
Twitter: https://twitter.com/phipps0218

MIA99s
Frequent Visitor

Yeayyy and ohhh I use DisplayMode but not insert edit and disabled code. Sorry my bad, newbie here. So far everything work for me afterb using your code. Thanks you so muchhhhhh!!! And my last request is, if next day I have 2 Sharepoint list for user.. I will use this code right? Correct me if I'm wrong

If(!IsBlank(LookUp(AdminAccess, Title = varUserEmail.Mail).Title) || (LookUp(StaffAccess, Title = varUserEmail.Mail).Title), DisplayMode.Edit, DisplayMode.Disabled)

 

It should work, but you're missing a boolean operator after your Or statement (||)

 

I'm assuming you meant to post it like this: 

 

If(!IsBlank(LookUp(AdminAccess, Title = varUserEmail.Mail).Title) || !IsBlank(LookUp(StaffAccess, Title = varUserEmail.Mail).Title), DisplayMode.Edit, DisplayMode.Disabled)
MIA99s
Frequent Visitor

Thank you so much for fixing for me @Aapok 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (3,862)