web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Office365Group: Add / ...
Power Apps
Answered

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

(1) ShareShare
ReportReport
Posted on by

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!

Categories:
I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    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,

  • CU24061526-1 Profile Picture
    on at

    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!

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    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,

  • DennisKuhn1 Profile Picture
    33 on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 547

#2
WarrenBelz Profile Picture

WarrenBelz 444 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard