cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thunter
Post Prodigy
Post Prodigy

Disable Button based on USer

Right now I have a button that is only Visible if the user is in a Collection called "IsManager". However, I would rather the button be visible but Disabled instead. So I am trying to do this in the DisplayMode depending on if the user falls into the collection IsManager. Any help with the formula? Thank you.

 

If(IsManager=true then Disabled=false) or If(IsManager=false then Disabled=true)

 

3b42abf1d659f2251cc33f2af05adda4.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
mdevaney
Super User
Super User

@thunter 

Is manager appears to be a boolean (true/false) variable from what you have typed rather than a collection.  If this is the case you should put the code below in your DisplayMode property for the button.

 

 

If(IsManager=true,Edit,Disabled)

 

 

If IsManager is in fact a collection please supply the column names and a sample of what data is held in the collection.

 

---
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

@thunter 

Sorry, do this instead: If(IsManager=true,Edit,Disabled) 

View solution in original post

3 REPLIES 3
mdevaney
Super User
Super User

@thunter 

Is manager appears to be a boolean (true/false) variable from what you have typed rather than a collection.  If this is the case you should put the code below in your DisplayMode property for the button.

 

 

If(IsManager=true,Edit,Disabled)

 

 

If IsManager is in fact a collection please supply the column names and a sample of what data is held in the collection.

 

---
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."

@mdevaney 

 

So when I use the formula If(IsManager=true,View,Disabled) for users that are not in the IsManager collection, the button shows but is greyed-out, for users who are in the IsManager collection, the button shows full color but user cannot click on button. I also have the Visible set to true, would that make a difference? Thank you.

@thunter 

Sorry, do this instead: If(IsManager=true,Edit,Disabled) 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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