Show/Hide a button webpart in sharepoint online based on group of logged in user
Hi Guys,
I need recommendation on a requirement that I have regarding controlling visiblity of a “button” webpart in SharePoint based on the M365 group of the logged in user.
For example if logged in user belongs to M365 Group A, then hide the button webpart, whereas show it when the logged in user belongs to the M365 Group B.
This is the button webpart that I want to conditionally show/hide based on group that logged in user belongs to
I have done some basic research and my understanding is that :
1. Only some type of webparts can be “Target audienced”, and button webpart does not fall in that category
2. It may be possible to show or hide button webpart based on a javascript code. However I am unable to see any “content editor” or “Script editor” webpart, when trying to add it to a SP page containing that button webpart.
If point 2 above is the only option to conditionally hide button webpart,pls advice how can I go about it (how to embed code in this page based on a script that can get the parameters such as M365 group id, webpart id etc)
Hi Guys, I need recommendation on a requirement that I have regarding controlling visiblity of a “button” webpart in SharePoint based on the M365 group of the logged in user. For example if logged in user belongs to M365 Group A, then hide the button webpart, whereas show it when the logged in user belongs to the M365 Group B. This is the button webpart that I want to conditionally show/hide based on group that logged in user belongs toI have done some basic research and my understanding is that : 1. Only some type of webparts can be “Target audienced”, and button webpart does not fall in that category2. It may be possible to show or hide button webpart based on a javascript code. However I am unable to see any “content editor” or “Script editor” webpart, when trying to add it to a SP page containing that button webpart.If point 2 above is the only option to conditionally hide button webpart,pls advice how can I go about it (how to embed code in this page based on a script that can get the parameters such as M365 group id, webpart id etc) Read More