cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Adding a user to a Microsoft Team or Office365 group

Hello,

 

I'm having difficulties with adding users to an Office365 group.

These are my flows:

Flow 1: Takes the input from a Microsoft Form to a Sharepoint List.

Flow 2: Triggers whenever a new item is added to the Sharepoint list. Starts an approval. After the approval the user is created in Azure AD.

After the user is created in Azure AD I add the user to an office365 group using the Office365 groups -> Add member to group action.

I select the group from the drop down and I user the UPN based collected from the previous Azure AD -> create user action.

 

For some reason I keep getting this error: Action add user to group failed: Invalid target for navigation property update. URI must target an entity.

 

I already tried using the GUID but this gives me an error: Resource '......0-8beb-4300-ae3e-1ef9f543a14e' does not exist or one of its queried reference-property objects are not present. I used the Powershell Get-UnifiedGroup command to get this GUID.

 

 

Hopefully someone can help me solve this issue 🙂

Thanks a lot!

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: Adding a user to a Microsoft Team or Office365 group

Ok so I found a solution to my problem which, to be fair, was mentioned in the link provided by abm: 

https://powerusers.microsoft.com/t5/Building-Flows/Use-a-flow-to-add-member-to-Office-365-group/td-p...

The problem is that it wasn't very clear from that post but in the Add member to group action you need to use the Email field. I used the User principal name field as that seemed logical (the label says User principal name).
 
upn.PNG
^not working
mail.PNG
^working
 
This seems to be a bug. I've addressed the issue to a support technician and he promised me he'd follow it up. I'll let you guys know when I hear something back. 
 
Thanks a lot to the people who were so kind to help me!

View solution in original post

12 REPLIES 12
Highlighted
Super User III
Super User III

Re: Adding a user to a Microsoft Team or Office365 group

Hi @Michaelvds 

 

This post might help.

 

https://powerusers.microsoft.com/t5/Building-Flows/Use-a-flow-to-add-member-to-Office-365-group/td-p...



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
Highlighted
Frequent Visitor

Re: Adding a user to a Microsoft Team or Office365 group

Hello,

Thanks for your answer! I found that post when doing some research to solve my issue. However the topic ends with a question.

What source should I use to extract the UPN from?
Highlighted
Super User III
Super User III

Re: Adding a user to a Microsoft Team or Office365 group

Hi @Michaelvds 

 

image.png

 

Thanks for your reply.

 

Use Search for users.

 

 



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

Re: Adding a user to a Microsoft Team or Office365 group

Hi,

Have you tried to use the Office 365 Groups action instead?

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others




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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Highlighted
Frequent Visitor

Re: Adding a user to a Microsoft Team or Office365 group

Hello,

 

So I just tried using the Search for users -> upn. This gives me the same error:

 

{
"error": {
    "code": "Request_BadRequest",
    "message": "Invalid target for navigation property update. URI must target an entity.",
    "innerError": {
      "request-id": "440538f1-b6ab-415c-a27b-1110d4f181d4",
      "date": "2020-03-05T14:11:29"
    }
  }
 
Here's an overview of my flow:
 
}flow.PNG
Highlighted
Super User III
Super User III

Re: Adding a user to a Microsoft Team or Office365 group

Hi,
The error is inside the apply to each loop. Can you open that in the run and post picture

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others




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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Highlighted
Frequent Visitor

Re: Adding a user to a Microsoft Team or Office365 group

Hi,

Thanks for your assistance!addMember.PNG

Highlighted
Super User III
Super User III

Re: Adding a user to a Microsoft Team or Office365 group

@Michaelvds 

That is weird..

 

Are you selecting the group from the dropdown list in the action?

 

 —Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others





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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Highlighted
Frequent Visitor

Re: Adding a user to a Microsoft Team or Office365 group

Yes, I do.

Highlighted
Super User III
Super User III

Re: Adding a user to a Microsoft Team or Office365 group

Hi @Michaelvds 

 

Are you searching one user or multiple (Search for users v2)?

 

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
Highlighted
Frequent Visitor

Re: Adding a user to a Microsoft Team or Office365 group

Hi,

 

I'm using Search for users v2 (limited to 1 entry)

sful.PNG

Highlighted
Frequent Visitor

Re: Adding a user to a Microsoft Team or Office365 group

Ok so I found a solution to my problem which, to be fair, was mentioned in the link provided by abm: 

https://powerusers.microsoft.com/t5/Building-Flows/Use-a-flow-to-add-member-to-Office-365-group/td-p...

The problem is that it wasn't very clear from that post but in the Add member to group action you need to use the Email field. I used the User principal name field as that seemed logical (the label says User principal name).
 
upn.PNG
^not working
mail.PNG
^working
 
This seems to be a bug. I've addressed the issue to a support technician and he promised me he'd follow it up. I'll let you guys know when I hear something back. 
 
Thanks a lot to the people who were so kind to help me!

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Come join us today! Find your favorite faces from the community presenting at the Power Platform Community Conference!

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.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (3,487)