PowerApps - On App Start check if User belongs to SharePoint Group
This video explains how to check if current user belongs to SharePoint Group On App Start and Set the Startscreen based on membership.
Video also explains OnStart and StartScreen Property and their usage and workaround.
Below are formulas used:
PowerAutomate
===============
api call
-------
_api/web/sitegroups/getByName('Finance Group')/Users?filter=Email eq '@{triggerBody()['text']}'
compose
--------
body('Send_an_HTTP_request_to_SharePoint')['d']['results']
condition equals
-----------
equals(String(outputs('Compose')),'[]')
PowerApps
=============
OnStart
------------
Set(isMember,CheckFinanceGroupMembership.Run(User().Email).ismember);
If(isMember = "True", Set(navigationTarget, "Scr_Search"), Set(navigationTarget, "Scr_NoAccess"))
Timer controls
=======
AutStart :true
OnTimerEnd
-------------------
If(navigationTarget = "Scr_Search", Navigate(Scr_Search),Navigate(Scr_NoAccess));
Пікірлер: 9
This is brilliant. You are very patient and detailed and I learned a lot. Thanks so much!
@m365techhelp
4 ай бұрын
Glad it helped!
Had this issue just recently found a solution for SPO and DV access, but this is a good alternative.
Nice video. An alternative approach would be to grant access to a list item only to the SP group and trying to access that item in PowerApps. Can avoid flow in that case.
Hi, for some reason the flow is running well but is always giving the VarIsMember value as false.. Any possible solution? everything is exactly as the flow in the video.
thank you for this
@Soulebi03
5 ай бұрын
your formula checks if the user group has 0 members in it. if it has multiple members it will always say true regardless if the indicated user email is in there
@m365techhelp
5 ай бұрын
You're very welcome!
Perfect video, I was looking for this to check user is present in a user group or not I have a small request, if u can make video on this topic How to enable Run only user in Power Automate with SharePoint as data source for a manual Trigger flow. It's difficult for me to be provide run only use to few people