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

Office365Group: Add / Remove Members (The data returned in the reponse is invalid)

Good morning!

I have an O365 group that I want to add and remove members to. The initial call action per request is successful but returns an invalid response which prevents me from adding / removing additional members.  The questions are,
"How do I avoid returning an invalid response?"
"How do I handle formula reponse errors?"

 

The steps I took to receive the error includes:

 

1. OnSelect property of a button with groupID and UPN (no issues):
AddUser365-1.png

2. After clicking button, user has been successfully added to the group. Button object fails and returns invalid response:
AddUser365-2.png

3. Attempt to remove the added user to the group using groupID and UPN:
RemoveUser365-1.png

4. After clicking the button, the removal of the member is successful.  Button object returns a failed response:
RemoveUser365-2.png

 

Any help would be greatly appreciated! Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Office365Group: Add / Remove Members (The data returned in the reponse is invalid)

Hi @MrNguyen ,

Based on the issue that you mentioned, I have made a test, and the issue is confirmed on my side. Even though, the Office365Groups.AddMemberToGroup(...) formula add a user to a specific group successfully, it would still show up the "The data returned in the response is invalid" error.

 

Based on this issue, I think it is related to Office 365 service API. I would post this issue to my product team, if this issue is solved, I would reply here.

 

As an alternative solution, I think the AzureAD connector could achieve your needs. I have made a test on my side, please take a try with the following workaround:5.JPG

 

6.JPG

 

7.JPG

Add a Dropdown (Dropdown1) in your app, set the Items property to following:

Office365Groups.ListOwnedGroups().value

Add two buttons in your app -- "Add User To Group" & "Remove User From Group". Set the OnSelect property of the "Add User To Group" button to following:

AzureAD.AddUserToGroup(Dropdown1.Selected.id, AzureAD.GetUser("Test2@Wicren.onmicrosoft.com").id)

on your side, you may type:

AzureAD.AddUserToGroup(Dropdown1.Selected.id, AzureAD.GetUser(_UserPrincipalName).id)

Set the OnSelect property of the "Remove User From Group" button to following:

AzureAD.RemoveMemberFromGroup(Dropdown1.Selected.id, AzureAD.GetUser("Test2@Wicren.onmicrosoft.com").id)

On your side, you may type:

AzureAD.RemoveMemberFromGroup(Dropdown1.Selected.id, AzureAD.GetUser(_UserPrincipalName).id)

Please consider take a try with above alternative solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Office365Group: Add / Remove Members (The data returned in the reponse is invalid)

Hi @MrNguyen ,

Based on the issue that you mentioned, I have made a test, and the issue is confirmed on my side. Even though, the Office365Groups.AddMemberToGroup(...) formula add a user to a specific group successfully, it would still show up the "The data returned in the response is invalid" error.

 

Based on this issue, I think it is related to Office 365 service API. I would post this issue to my product team, if this issue is solved, I would reply here.

 

As an alternative solution, I think the AzureAD connector could achieve your needs. I have made a test on my side, please take a try with the following workaround:5.JPG

 

6.JPG

 

7.JPG

Add a Dropdown (Dropdown1) in your app, set the Items property to following:

Office365Groups.ListOwnedGroups().value

Add two buttons in your app -- "Add User To Group" & "Remove User From Group". Set the OnSelect property of the "Add User To Group" button to following:

AzureAD.AddUserToGroup(Dropdown1.Selected.id, AzureAD.GetUser("Test2@Wicren.onmicrosoft.com").id)

on your side, you may type:

AzureAD.AddUserToGroup(Dropdown1.Selected.id, AzureAD.GetUser(_UserPrincipalName).id)

Set the OnSelect property of the "Remove User From Group" button to following:

AzureAD.RemoveMemberFromGroup(Dropdown1.Selected.id, AzureAD.GetUser("Test2@Wicren.onmicrosoft.com").id)

On your side, you may type:

AzureAD.RemoveMemberFromGroup(Dropdown1.Selected.id, AzureAD.GetUser(_UserPrincipalName).id)

Please consider take a try with above alternative solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Frequent Visitor

Re: Office365Group: Add / Remove Members (The data returned in the reponse is invalid)

Hi @v-xida-msft 
Thanks for the reply! Using the AzureAD does indeed work! Thanks a ton! Looking forward to resolving the Office365Groups connector as well!

Highlighted
Community Support
Community Support

Re: Office365Group: Add / Remove Members (The data returned in the reponse is invalid)

Hi @MrNguyen ,

Is the solution I provided above helpful in your scenario?

 

If you have solved your problem, please go ahead to click the "Accept as Solution" to identify this thread has been solved. If the Office365Groups connector issue has been fixed, I would also reply here.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Advocate I
Advocate I

Re: Office365Group: Add / Remove Members (The data returned in the reponse is invalid)

Thanks @MrNguyen for documenting the issue, I can confirm it.

@v-xida-msft thanks for the solution. Are there any updates on Office365Groups connector? E.g. is it in progress?

 

Cheers, Dennis

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

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

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.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,758)