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

Use a flow to add member to Office 365 group

Hey guys,

 

I am curious if it is possible to use flows to add members to Office 365 groups, I haven't found a method yet. If it isn't possible I'll post it into the ideas section.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Use a flow to add member to Office 365 group

Hi @ChrisC,

 

This feature is not available yet. Please post this to ideas forum.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



View solution in original post

Highlighted
PhilD
Level 8

Re: Use a flow to add member to Office 365 group

Tinkered around with this and got it working at the most basic level using the construct shown below. Maybe this will help someone else. I couldn't get it working using an array variable for some reason, using the normal method kept returning an empty array when appending the email from the trigger item. Using the UPN from the search user (limited to 1 result) worked so I just went with that for now (just glad it is working).

 

 

AddMemberToO365_Group.jpg

View solution in original post

15 REPLIES 15
Super User
Super User

Re: Use a flow to add member to Office 365 group

Hi @ChrisC,

 

This feature is not available yet. Please post this to ideas forum.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



View solution in original post

Community Support Team
Community Support Team

Re: Use a flow to add member to Office 365 group

Hi ChrisC,

 

Currently it is not possible to use flow to add members to Office 365 groups. Please consider to submit it as an idea in Flow Ideas Forum at here:
https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

 

Thanks for your feedback. I will also report this from my side.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Michael_Kirst
Level: Powered On

Re: Use a flow to add member to Office 365 group

Hi,

you can using an Azure Job with powershell

 

####################################################

Param
 (
 [Parameter(Mandatory=$true)]
 [string] $CredentialsName = "YOUR_Automation_Account",
 [Parameter (Mandatory= $true)]
 [String] $DisplayName = "",
 [Parameter (Mandatory= $true)]
 [String] $Members = ""

 )


Connect-EXO

 

Add-UnifiedGroupLinks `
    -Identity $DisplayName `
    -LinkType "Members" `
    -Links $Members

 

#############################

 

You need additonal PS Module to connection Exchange Online (Connect-EXO)

I'm using it in a PowerApp for a customer.

 

Michael

Berny
Level 8

Re: Use a flow to add member to Office 365 group

There is a connector for this now 

 Capture.PNG

PhilD
Level 8

Re: Use a flow to add member to Office 365 group

The add member straight up does not work. Which ever way the email field is defined, either by using a user's email  from a previous step or typing it directly in, this message is returned on failure. There are only two fields to complete so not sure what else can be done. The "list members"  step works fine however.

 

{
  "error": {
    "code": "Request_BadRequest",
    "message": "Invalid target for navigation property update. URI must target an entity.",
    "innerError": {
      "request-id": "03f24a23-daa8-456e-a097-2225071553bc",
      "date": "2018-08-07T00:43:00"
    }
  }
}
Berny
Level 8

Re: Use a flow to add member to Office 365 group

Members is an array of email addresses. Took me a while to get I but I finally got that.

Group name is a GUID. Just to make life fun. I found the guid by listing all groups owned my the owner and matched for the name.

PhilD
Level 8

Re: Use a flow to add member to Office 365 group

Thanks for the tip @Berny, I'll try this out as soon as I can.

 

I only had one address and the connection is named "Add member..." (with "member" being singular) so I guess I wasn't thinking about this entry as an array.

 

I'l let you know how this works and thanks again for pointing this out.

Berny
Level 8

Re: Use a flow to add member to Office 365 group

For a single person I was able to use a string to pass it. I did find that you can not have a semi colon at the end of the email address. 

 

The other part that definately gave me greif was finding the GUID for the group. Are you using the group's GUID?

PhilD
Level 8

Re: Use a flow to add member to Office 365 group

Not in the app at the moment but for me the Groups displayed as a long list of text entries in a dropdown box so I presume when I selected one, the GUID was passed behind the scenes but I didn't explicitly try to use it. 

Berny
Level 8

Re: Use a flow to add member to Office 365 group

Ah yes - if you don't have to automatically select the group it is much easier with that drop down list.

jabarnwe
Level: Powered On

Re: Use a flow to add member to Office 365 group

@Berny, can you help me figure out what I am doing wrong with this connector? I have an email address. I have even run it through a trim operation to ensure I don't have white space issues. I used the drop down selector fo the Outlook Group to send my new member to, so I think the guid should be correct. Do I have to wrap the email address in an array?

 

Flow adding member to Outlook Group.png

Berny
Level 8

Re: Use a flow to add member to Office 365 group

Overall it looks like you have things setup correctly.

 

here is what I would do 

 

> create a simple flow (manual trigger or timer trigger + add member to group action)

 

> manually select the group and add the user's email address

 

see if this work, then try with the same information in your larger flow.

 

 

That error message is annoying as it does not really explain well what is going wrong, but I got it all the time as well (I think the error message could be related to either field even, but it may just be for the group ID since I did always have the semicolon in the email address.

 

So the best thing I can suggest is just take it step by step and see what happens.

 

Oh and try actually entering the GUID for the group and see if that works. You can get the guid using Powershell > Connect to Azure AD -  

Get-AzureADGroup -SearchString <group name>

That will give you the GUID for the group so you can try it that way.

Highlighted
PhilD
Level 8

Re: Use a flow to add member to Office 365 group

Tinkered around with this and got it working at the most basic level using the construct shown below. Maybe this will help someone else. I couldn't get it working using an array variable for some reason, using the normal method kept returning an empty array when appending the email from the trigger item. Using the UPN from the search user (limited to 1 result) worked so I just went with that for now (just glad it is working).

 

 

AddMemberToO365_Group.jpg

View solution in original post

sidddhartha
Level: Power Up

Re: Use a flow to add member to Office 365 group

This helped me resolve my issue. Extracting the UPN from email was the solution.

ceperezb
Level: Powered On

Re: Use a flow to add member to Office 365 group

can you share how you extracted UPN from email? 

Helpful resources

Announcements
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 Kudoed Authors (Last 30 Days)
Users online (5,945)