cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Michaelvds
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
Michaelvds
Frequent Visitor

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

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 blogPower Automate Video Tutorials
Michaelvds
Frequent Visitor

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?

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 blogPower Automate Video Tutorials

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





Michaelvds
Frequent Visitor

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

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





Michaelvds
Frequent Visitor

Hi,

Thanks for your assistance!addMember.PNG

@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





Michaelvds
Frequent Visitor

Yes, I do.

abm
Super User III
Super User III

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 blogPower Automate Video Tutorials
Michaelvds
Frequent Visitor

Hi,

 

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

sful.PNG

Michaelvds
Frequent Visitor

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
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

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

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Users online (31,537)