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

Community site session details

Session Id : 48HkpDYgGF/c/nJZGdiefy
Power Automate - Building Flows
Answered

Searching if email is in the sharepoint group

Like (0) ShareShare
ReportReport
Posted on 20 Feb 2024 03:20:17 by 683 Super User 2025 Season 2

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.

  • KevinGador Profile Picture
    683 Super User 2025 Season 2 on 20 Feb 2024 at 11:57:35
    Re: Searching if email is in the sharepoint group

    worked wonderfully! also appreciate the explanation while you teach the right thing to do.  

    Thanks @Expiscornovus 

  • Verified answer
    Expiscornovus Profile Picture
    32,205 Most Valuable Professional on 20 Feb 2024 at 11:03:42
    Re: Searching if email is in the sharepoint group

    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

     

    filterqueryparameter.png

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2