cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Change Displaymode to disabled on a button if an email exists in a specific column in a sharepoint list

Hi,

 

I need to change the Displaymode to disabled on a button if an email exists in a certain column on a sharepoint list. 

The idea is that it will use Office365Users.MyProfile().mail to get the current users email and look up to see if that email exists in the column. If it exists in the column the it will be Displaymode.Disabled if it doesnt exist then it will be Displaymode.Edit.

 

Would be greatful for any suggestions.

 

Thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User
Super User

Re: Change Displaymode to disabled on a button if an email exists in a specific column in a sharepoint list

@CBI_Oshin
You could try putting this code in the DisplayMode property of your button

If(Office365Users.MyProfile().mail in your_datasource_name.your_column_name, Disabled, Edit)

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

Highlighted
Super User
Super User

Re: Change Displaymode to disabled on a button if an email exists in a specific column in a sharepoint list

Hi @CBI_Oshin,

You could just put the following formula on the DisplayMode property of your button control:

If(IsBlank(LookUp(<YourList>,<YourEmailColumn>=Office365Users.MyProfile().mail)), DisplayMode.Edit, DisplayMode.Disabled)

In other words, if an item in your list does note exist with the user's email then the button is active. Otherwise, it is disabled.

Hope this helps. If it does, please consider accepting this post as the solution.

Emmanuel

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

Re: Change Displaymode to disabled on a button if an email exists in a specific column in a sharepoint list

@CBI_Oshin
You could try putting this code in the DisplayMode property of your button

If(Office365Users.MyProfile().mail in your_datasource_name.your_column_name, Disabled, Edit)

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

Highlighted
Super User
Super User

Re: Change Displaymode to disabled on a button if an email exists in a specific column in a sharepoint list

Hi @CBI_Oshin,

You could just put the following formula on the DisplayMode property of your button control:

If(IsBlank(LookUp(<YourList>,<YourEmailColumn>=Office365Users.MyProfile().mail)), DisplayMode.Edit, DisplayMode.Disabled)

In other words, if an item in your list does note exist with the user's email then the button is active. Otherwise, it is disabled.

Hope this helps. If it does, please consider accepting this post as the solution.

Emmanuel

View solution in original post

Highlighted
Helper II
Helper II

Re: Change Displaymode to disabled on a button if an email exists in a specific column in a sharepoint list

Thank you this worked!

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,425)