web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Show/Hide or Enable/Di...
Power Apps
Answered

Show/Hide or Enable/Disable button or icon in powerapps

(1) ShareShare
ReportReport
Posted on by 522

I want to Show/Hide or Enable/disable the button or icon in powerapps based on SharePoint user role. As some would have access to download and some not, similarly i want to implement on powerapps and same also for upload button.

Categories:
I have the same question (0)
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Nikhil2 

    Please try the following, (change list, column names as applicable)

    In the Vivible property of the Button,

    !IsBlank(LookUp(yourSPList, userEmailColumn=User().Email, userRoleColumn="whatever user role"))

  • Nikhil2 Profile Picture
    522 on at

    Hello @CNT,

     

    It is not list, it is library i have created custom group where group do not have download/upload permission only view and another group has only download not upload.

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Nikhil2 checkout this video from Dhruvin, which shows how to check if the user belongs to a Group, https://www.youtube.com/watch?v=CyzU1VNItyw

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

  • Nikhil2 Profile Picture
    522 on at

    But i see that works for Office 365 groups but not for SP group. 

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Nikhil2 :

    If you want to get a SharePoint Site Group's members,I suggest you insert a flow into your app. I've made a test for your reference:

    1\First,get the group id

    vbofengmsft_0-1639469798857.png

    2\Create a flow:

    vbofengmsft_2-1639469993173.png

     

    Schema

    {
     "type": "object",
     "properties": {
     "d": {
     "type": "object",
     "properties": {
     "results": {
     "type": "array",
     "items": {
     "type": "object",
     "properties": {
     "__metadata": {
     "type": "object",
     "properties": {
     "id": {
     "type": "string"
     },
     "uri": {
     "type": "string"
     },
     "type": {
     "type": "string"
     }
     }
     },
     "Alerts": {
     "type": "object",
     "properties": {
     "__deferred": {
     "type": "object",
     "properties": {
     "uri": {
     "type": "string"
     }
     }
     }
     }
     },
     "Groups": {
     "type": "object",
     "properties": {
     "__deferred": {
     "type": "object",
     "properties": {
     "uri": {
     "type": "string"
     }
     }
     }
     }
     },
     "Id": {
     "type": "integer"
     },
     "IsHiddenInUI": {
     "type": "boolean"
     },
     "LoginName": {
     "type": "string"
     },
     "Title": {
     "type": "string"
     },
     "PrincipalType": {
     "type": "integer"
     },
     "Email": {
     "type": "string"
     },
     "Expiration": {
     "type": "string"
     },
     "IsEmailAuthenticationGuestUser": {
     "type": "boolean"
     },
     "IsShareByEmailGuestUser": {
     "type": "boolean"
     },
     "IsSiteAdmin": {
     "type": "boolean"
     },
     "UserId": {
     "type": "object",
     "properties": {
     "__metadata": {
     "type": "object",
     "properties": {
     "type": {
     "type": "string"
     }
     }
     },
     "NameId": {
     "type": "string"
     },
     "NameIdIssuer": {
     "type": "string"
     }
     }
     },
     "UserPrincipalName": {
     "type": "string"
     }
     },
     "required": [
     "__metadata",
     "Alerts",
     "Groups",
     "Id",
     "IsHiddenInUI",
     "LoginName",
     "Title",
     "PrincipalType",
     "Email",
     "Expiration",
     "IsEmailAuthenticationGuestUser",
     "IsShareByEmailGuestUser",
     "IsSiteAdmin",
     "UserId",
     "UserPrincipalName"
     ]
     }
     }
     }
     }
     }
    }

    3\Share the flow

    vbofengmsft_3-1639470030181.png

    vbofengmsft_4-1639470139332.png

    4\Add the flow into your app

    vbofengmsft_5-1639470174232.png

    5\Add a button and set it's OnSelelct property to:

    ClearCollect(GroupUsers,Bof1214New.Run().d.results)

    6\Click the button added in step 5 and use this formula to determine whether the user is in the specified SP Site Group

    User().Email in GroupUsers.Email

    Best Regards,

    Bof

     

  • Nikhil2 Profile Picture
    522 on at

    @v-bofeng-msft Thank you for your suggestion, my intention was to grey out or enable based on the SP group permission example: read group users will not have access to download or upload, but contribute or full control will have or should have ability to download files. So does the above procedure work on both scenarios ?

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Nikhil2 :

    Yes, you can obtain the members of the two groups separately, store them in two different collections, and then determine which group the current user belongs to. (The logically easiest way to understand is to create two flows, and then execute each one to store the members of the two groups in different collections).

    Best Regards,

    Bof

  • Nikhil2 Profile Picture
    522 on at

    @v-bofeng-msft on step 6 which Action i should add the formula into ?

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Nikhil2 :

    You can directly put it in the visible property of the control you want to show/hide.If the current user is in this group, then this control will display.

    Best Regards,

    Bof

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard