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):
2. After clicking button, user has been successfully added to the group. Button object fails and returns invalid response:
3. Attempt to remove the added user to the group using groupID and UPN:
4. After clicking the button, the removal of the member is successful. Button object returns a failed response:
Any help would be greatly appreciated! Thanks!
Solved! Go to Solution.
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:
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,
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:
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,
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!
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,
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
User | Count |
---|---|
121 | |
88 | |
88 | |
75 | |
66 |
User | Count |
---|---|
216 | |
180 | |
138 | |
96 | |
80 |