cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mahmoodhsaud
Helper IV
Helper IV

How to filter current user from the Azure AD group

Hi Everyone,

I need to create a flow to send an approval request to everyone in the group except the current user.

The flow needs to be triggered from the canvas app. The current user should be filtered from the group and the rest of the members will receive the approval request.

How to achieve this flow?

 

Thanks in advance

Regards,

Mahmood

2 ACCEPTED SOLUTIONS

Accepted Solutions
eric-cheng
Solution Sage
Solution Sage

Hi @mahmoodhsaud 

 

You could use the list group members and append to a string variable whilst excluding the current user.  You could also use a string replace function to remove the current user.

 

Screenshot_20210710-001946_Chrome.jpg

There is also the below for AAD groups.

 

1.png

View solution in original post

Hi @mahmoodhsaud ,

 

The above example will return all members but you should be able to parse the returned JSON and exclude the current user.

 

ericcheng_0-1626257948200.png

 

The connector uses Graph API but there is no ability to filter.  If you want a more elegant solution, you can call the Graph API yourself which will allow more granular control.  You can read more here.

ericcheng_1-1626258029864.png

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

 

View solution in original post

3 REPLIES 3
eric-cheng
Solution Sage
Solution Sage

Hi @mahmoodhsaud 

 

You could use the list group members and append to a string variable whilst excluding the current user.  You could also use a string replace function to remove the current user.

 

Screenshot_20210710-001946_Chrome.jpg

There is also the below for AAD groups.

 

1.png

View solution in original post

Hi @eric-cheng, Thanks for your inputs

I wanted to get all the mail ID expect the current users. But if we are using variable is it possible to retrieve all users

Hi @mahmoodhsaud ,

 

The above example will return all members but you should be able to parse the returned JSON and exclude the current user.

 

ericcheng_0-1626257948200.png

 

The connector uses Graph API but there is no ability to filter.  If you want a more elegant solution, you can call the Graph API yourself which will allow more granular control.  You can read more here.

ericcheng_1-1626258029864.png

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

 

View solution in original post

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,308)