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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,902)