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

Hide Button based on user email and column in sharepoint

Hi,

I am trying to show/hide a button based on sharepoint value.

For Example, i want only a user with a designation of

1. Admin or PM and

2. column email to be equal to user().email

to be able to see the see the Button called PM

I would appreciate any help

 

damiosiks_1-1656459532749.png

 

damiosiks_0-1656459479066.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

@damiosiks ,

Is Designation a Choice field ?

With(
   {
      wRole:
      LookUp(
         AddColumns(
            NAGLookupTable,
            "Role",
            Designation.Value
         ),
         Email = User().Email
      ).Role
   },
   wRole = "Admin" || wRole = "PM"
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

5 REPLIES 5
WarrenBelz
Super User
Super User

Hi @damiosiks ,

The first one is below (the logged in user is Admin or PM) - what exactly do you mean by the second one (what column are you comparing to the user's email) - the button is not inside a gallery as far as I can see)

With(
   {
      wRole:
      LookUp(
         NAGLookupTable,
         Email = User().Email
      ).Designation
   },
   wRole = "Admin" || wRole = "PM"
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

Hi @WarrenBelz , thank you for the reply Yes the button is not in a gallery. kindly ignore no "2"

 

i am having an error. does it have to be in the visible property of the button?

 

damiosiks_0-1656460926970.png

 

Here is the Error

 

damiosiks_0-1656461874172.png

 

@damiosiks ,

Is Designation a Choice field ?

With(
   {
      wRole:
      LookUp(
         AddColumns(
            NAGLookupTable,
            "Role",
            Designation.Value
         ),
         Email = User().Email
      ).Role
   },
   wRole = "Admin" || wRole = "PM"
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

WarrenBelz
Super User
Super User

Hi @damiosiks ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,827)