Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Searching if email is in the sharepoint group

(0) ShareShare
ReportReport
Posted on by 600 Super User 2025 Season 1

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
    600 Super User 2025 Season 1 on at
    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
    31,897 Most Valuable Professional on at
    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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492