Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Error adding O365 user group

I get the follow duplicate error when adding a user group to my app even though the user group is not listed as a user!

{"devError":"Cannot create team for undefined.","statusCode":400,"contentId":1,"body":"{\"error\":{\"code\":\"0x8004022a\",\"message\":\"Duplicate record exists. Cannot insert duplicate key row in object 'dbo.TeamBase' with unique index 'ndx_TeamName_BusinessUnitId'. The duplicate key value is <redacted>.\"}}"}

Advocate I
Advocate I

I get the same error in a flow when I try to start an approval with a mail-enabled security group:

BadRequest. Fehler bei Anforderung. Fehlercode: "XrmApiRequestFailed". Fehlermeldung: "Fehler bei XRM-API-Anforderung: "Message: Duplicate record exists. Cannot insert duplicate key row in object 'dbo.TeamBase' with unique index 'ndx_TeamName_BusinessUnitId'. The duplicate key value is <redacted>. Code: 0x8004022a InnerError: ".".

Frequent Visitor

@aboehm We're getting the same error when trying to send approvals to a mail enabled O365 group. Did you ever find a solution/explanation for this problem? 

Advocate I
Advocate I

@Kevin_Centric Unfortunately no, I had not found any solution nor any explanation for this issue. Instead I created a workaround by allowing multiple "assignedTo" addresses for the approvals in my flow, so there was no longer a need for the mail-enabled security group.

It isn't ideal because theses addresses come from a single SharePoint column, which i can't restrict to only "usable" addresses. So some users may enter data which let the flow just explode instead of displaying a message to the user in an expectable error condition.

I decided to implement a workaround as well.
The setup looks the same as the one you're describing, with the addresses coming from a SP list.
Instead of having the customer add the addresses for every user which needs to receive a approval we decided to keep using the O365 groups. However, instead of sending the approvals to the group directly we use the O365 Groups connector to retrieve the group and its members based on the mail address in the SP list.
We then append all group members email addresses' to a string, which is used as the "recipients" value in the approval.

This way the solution will stay flexible and won't require additional maintenance from the customer.
As an added bonus end user now receive the approval in Teams as well, which according to the docs isn't currently supported when using O365 groups directly.


I did contact Microsoft support, which said is probably had something to do with the rights of the users within the security group, referring to Azure support for further investigation. As the workaround was pretty simple to implement and also provides a better UX I've not gone into any further investigation. 

Could you give some screenshots to show how you did these things? I'm struggling with the same thing, and I'm not exactly sure how to do what you are explaining with pulling the members based on a SP list and then turning it into a string for the approval recipient.  I would appreciate it very much!

Helpful resources

Ignite 2022


Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (3,903)