cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
JimmyWork
Level 8

Add user to Group (Check if user already exists in group)

Hi 

 

Is it possible to check if a user is already added to a group before trying to add him/her?

Im doing a Add user to Group - Azure and it will fail if the user is already in the group.

Im adding users from a SharePoint Person column. And if thye user is already in the group the flow will fail.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: Add user to Group (Check if user already exists in group)

 

Hi @JimmyWork ,

 

Sorry, I understand what you mean wrong.

In addition, you can also try this method below.

42.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Community Support Team
Community Support Team

Re: Add user to Group (Check if user already exists in group)

 

Hi @JimmyWork ,

 

This is the expected result because the result of the Condition is false, so Add member to group action will not be executed. Then your problem will be solved.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

9 REPLIES 9
Harry_G
Level 10

Re: Add user to Group (Check if user already exists in group)

Hi @JimmyWork ,

Can you tried List group Members Action? If not please try.

After getting group members you can apply loop for check each member's email. if user is not exist you can add it.

sample flow for help

1.JPG2.JPG

Thanks,

Harry_G

Community Support Team
Community Support Team

Re: Add user to Group (Check if user already exists in group)

 

Hi @JimmyWork ,

 

You only need to get the email of the specified user, and then configure Add member to group action.

If the current user is already a member of the specified group, the action will show that the execution failed.

36.PNG

37.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
JimmyWork
Level 8

Re: Add user to Group (Check if user already exists in group)

@v-bacao-msft Well i don't want the flow to say failed each time a user adds themself by mistake. If i get multiple emails saying my flow keeps on failing thats just not so good for me.

 

@Harry_G I will check this out today, thank you for helping out.

Community Support Team
Community Support Team

Re: Add user to Group (Check if user already exists in group)

 

Hi @JimmyWork ,

 

Sorry, I understand what you mean wrong.

In addition, you can also try this method below.

42.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

JimmyWork
Level 8

Re: Add user to Group (Check if user already exists in group)

@v-bacao-msft 

I tested your solution and it seems to work but i get a ActionBranchingConditionNotSatisfied but it still adds the correct users.

 

2019-09-27 14_09_53-Run History _ Microsoft Flow.png

Community Support Team
Community Support Team

Re: Add user to Group (Check if user already exists in group)

 

Hi @JimmyWork ,

 

This is the expected result because the result of the Condition is false, so Add member to group action will not be executed. Then your problem will be solved.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

JimmyWork
Level 8

Re: Add user to Group (Check if user already exists in group)

@v-bacao-msft I cant get this to work.

 

2019-10-20 14_59_05-Run History _ Microsoft Flow.png2019-10-20 15_00_31-Edit your flow _ Microsoft Flow.png

JimmyWork
Level 8

Re: Add user to Group (Check if user already exists in group)

@Harry_G I cant get this work, it works correctly if i do compose but as soon as i add, add to group i get error. It will add the user to the group but the conditions will gave error for some reason?

 

2019-10-20 15_17_36-Run History _ Microsoft Flow.png2019-10-20 15_18_09-Edit your flow _ Microsoft Flow.png2019-10-20 15_20_00-Run History _ Microsoft Flow.png

algreen88
Level: Powered On

Re: Add user to Group (Check if user already exists in group)

This is great @v-bacao-msft This method works a treat! May be worth adding this to a blog post for more visibilty. It's very useful for business processes we are implementing. 

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,523)