Hello,
I have this instant flow that is triggered in powerapps that will check if the current logged in user is part of the sharepoint group. The problem with my flow is that when a group contains multiple members it returns true and when it doesn't have any member in the group it returns false regardless if the email is in the group or not.
First, I initialize a boolean value to false.
then send an HTTP request to Sharepoint that filters the emails
with GET method
Uri :
_api/web/sitegroups/getByName('GROUP')/Users?filter=Email eq '@{triggerBody()['text']}'
then a compose action with the expression
@{body('Send_an_HTTP_request_to_SharePoint')['d']['results']}
after that a condition to check if the array is empty
equals(String(outputs('Compose')),'[]')
and if it is empty, the variable will be false meaning the user is not part of the group.
worked wonderfully! also appreciate the explanation while you teach the right thing to do.
Thanks @Expiscornovus
Hi @kej,
It looks like you made a small typo. It seems that you forgot the $ for the filter query parameter in your URI field. It should be $filter instead of filter.
Btw, it is not necessary to use a Compose action for this setup. You can use an expression directly in the Condition action as well.
Try something like below.
1. I used this Uri
_api/web/sitegroups/getByName('Custom SharePoint Group')/Users?$filter=Email eq '@{triggerBody()['text']}'
2. I added the nometadata headers. This way it will return the value property instead of the d/results property format.
{
"Accept": "application/json;odata=nometadata",
"Content-Type": "application/json;odata=nometadata"
}
3. In the condition I used a length function to check if the value array contains any items at all.
length(outputs('Send_an_HTTP_request_to_SharePoint')?['body']['value'])
is greater than 0
Tomac
986
Moderator
stampcoin
699
Super User 2025 Season 2
Riyaz_riz11
577
Super User 2025 Season 2