PowerApps - On App Start check if User belongs to SharePoint Group
Вставка
- Опубліковано 5 вер 2024
- 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));
This is brilliant. You are very patient and detailed and I learned a lot. Thanks so much!
Glad it helped!
Thanks for the video , But i had to do one correction here in order for the query to run _api/web/sitegroups/getByName('Group Name')/Users?$filter=Email eq 'Email'..... to put the $ before the filter to filter out the query
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.
Had this issue just recently found a solution for SPO and DV access, but this is a good alternative.
thank you for this
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
You're very welcome!
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.
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