cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Kudo Kingpin
Kudo Kingpin

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
Highlighted
Super User III
Super User III

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!

Learn more from my blog

Power Automate Video Tutorials

View solution in original post

Highlighted
Kudo Kingpin
Kudo Kingpin

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

17 REPLIES 17
Highlighted
Super User III
Super User III

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!

Learn more from my blog

Power Automate Video Tutorials

View solution in original post

Highlighted
Community Support
Community Support

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.
Highlighted
Regular Visitor

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

Highlighted
Advocate V
Advocate V

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

There is a connector for this now 

 Capture.PNG

Highlighted
Kudo Kingpin
Kudo Kingpin

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"
    }
  }
}
Highlighted
Advocate V
Advocate V

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.

Highlighted
Kudo Kingpin
Kudo Kingpin

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.

Highlighted
Advocate V
Advocate V

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?

Highlighted
Kudo Kingpin
Kudo Kingpin

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. 

Highlighted
Advocate V
Advocate V

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.

Highlighted
Microsoft
Microsoft

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

Highlighted
Advocate V
Advocate V

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
Kudo Kingpin
Kudo Kingpin

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

Highlighted
New Member

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.

Highlighted
Microsoft
Microsoft

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

can you share how you extracted UPN from email? 

Frequent Visitor

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

Not sure if it's still an issue for you but if not hope this helps others:

 

https://powerusers.microsoft.com/t5/Building-Flows/Adding-a-user-to-a-Microsoft-Team-or-Office365-gr...

Highlighted
Regular Visitor

Re: Use a flow to add member to Office 365 group(In that need the Group Id Dynamic )

ri.PNGwr.PNGWe want in the flow the “Group Id” has to be taken from the Excel file or any custom value. Group Id should not have to take the value from the Drop down list. Please refer the below Screen shot for the reference.

 
 

Please need the help

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,972)