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

Enable/Disable fields based on User

Hello,

 

I have 2 list:

Main List

Admin List

 

I want to enable/disable fields from Main list based on Users present in Admin List

like, Due date field will be enabled for users present in Admin List and for rest user it is disabled

 

Please help as soon as possible

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Enable/Disable fields based on User

@fd00094 

For example, you could create a SharePoint list called "AppAdmins", with a single Person column called 'PersonColumn'

 

PersonColumn
John Smith
Bob Dole

 

Then in your App's OnStart property use this code to create a true/false variable.

 

Set(isAdmin, User().Email in LookUp(AppAdmins, Title="Admin", myPersonField.Email))

 

 

Finally, put this code in the OnVisible property of the Admin button

 

isAdmin

 

 

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

View solution in original post

5 REPLIES 5
Highlighted
Power Apps
Power Apps

Re: Enable/Disable fields based on User

The question would be how your users would be present in your Admin List. If you´re using something like User().FullName or User().Email inside your Admin list, you could filter your Admin List based on this information. If you find a match with IsMatch() function, you could set a variable. Based on that variable you enable/disable your field from the Main list.

Highlighted
Helper III
Helper III

Re: Enable/Disable fields based on User

Hello @Carsten_Growth 

 

In Admin List i have 2 fields one title and 2nd people pickrer which will have multiple values
Like Admin - Title

A,B,C - People picker field values

 

So i want to check current logged in users is present in ABC or not

Highlighted
Super User
Super User

Re: Enable/Disable fields based on User

@fd00094 

For example, you could create a SharePoint list called "AppAdmins", with a single Person column called 'PersonColumn'

 

PersonColumn
John Smith
Bob Dole

 

Then in your App's OnStart property use this code to create a true/false variable.

 

Set(isAdmin, User().Email in LookUp(AppAdmins, Title="Admin", myPersonField.Email))

 

 

Finally, put this code in the OnVisible property of the Admin button

 

isAdmin

 

 

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

View solution in original post

Highlighted
Helper III
Helper III

Re: Enable/Disable fields based on User

Hello @mdevaney 

 

Getting invalid argument type error on = sign

 

Set(isAdmin, !IsBlank(LookUp(TicketAdmins, NotifyTo.Email=User().Email)))

 

NotifyTo is Person column and contains multiple values

Highlighted
Super User
Super User

Re: Enable/Disable fields based on User

@fd00094 
I wrote my response before you had said it was a mutliple user field, lol.  I have edited my code above to fit your situation.

 

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

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

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

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

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,153)