Skip to main content

Notifications

Community site session details
Power Automate - General Discussion
Answered

how to apply filter on "@odata.type": "#microsoft.graph.user" only on users

Like (0) ShareShare
ReportReport
Posted on 15 Feb 2023 12:11:20 by

Hi Mates,

 

I need to extract the Azure ad group users using MS graph API, API call pulls out all members from the groups.

This means Azure ad group users and a few other groups as members.

I would like to apply a filter to pull out only users from the group.

 

 {
 "@odata.type": "#microsoft.graph.user",
 "id": "7b0f0b83-406-b25a-1e70cc520ab0",
 "displayName": "xyz",
 },
 {
 "@odata.type": "#microsoft.graph.group",
 "id": "cd243e66-df16-2efc34ff2332",
 "displayName": "xyzgroup",
 },
 {
 "@odata.type": "#microsoft.graph.group",
 "id": "9c9855cd-4d16-0bf91ba16790",
 "displayName": "xyzgrou2",
 }

 

API : 
https://graph.microsoft.com/v1.0/groups/e917f888-4e6b-b1f1-40a58159/members

 

normally i can select like $Select=id, displayname but can i select only users?

Please assist me

  • Community Power Platform Member Profile Picture
    on 20 Feb 2023 at 15:58:19
    Re: how to apply filter on "@odata.type": "#microsoft.graph.user" only on users

    @Expiscornovus  Thank you

  • Verified answer
    Expiscornovus Profile Picture
    31,652 Most Valuable Professional on 15 Feb 2023 at 13:10:04
    Re: how to apply filter on "@odata.type": "#microsoft.graph.user" only on users

    Hi @Anonymous,

     

    You can use the Odata cast to only retrieve members which are of type user.

     

    Below is an example from the Graph API documentation:

    https://learn.microsoft.com/en-us/graph/api/group-list-members?view=graph-rest-1.0&tabs=http#example-3-use-odata-cast-to-get-only-a-count-of-user-membership

     

     

    GET https://graph.microsoft.com/v1.0/groups/{id}/members/microsoft.graph.user

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,079 Most Valuable Professional

Leaderboard
Loading started
Loading started
Loading complete