I have this code inside the OnSelect property of a button inside Power Apps canvas application, to get the members of a security group:-
Set(
wAdminID1_1,
LookUp(
Office365Groups.ListGroups({'$filter': "startswith(displayName," & "'PPM'" & ")"}).value,
displayName = varITMGGroupName
).id
);
now this is working well for me as i am the admin, but for an external user , the user is getting this error:-
so not sure is this error related to that the user is external or that the user is not admin?
the group is a security group without email, as follow:-
any advice?
The error "Insufficient privileges" usually occurs if the user does not have required permissions or roles to perform the operation.
Usually, external users have limited access to directory objects and will get same error from Portal too:
In your case, check below settings to know what access guest users currently have:
To resolve the error, they should be assigned with proper administrator role like this:
After assigning the role, external user can access the group without any error:
Similarly, I used below code in OnSelect
property of buttons inside Power Apps canvas application after assigning role and got response like this:
Get Group ID:
Set(
wAdminID1_1,
LookUp(
Office365Groups.ListGroups({'$filter': "startswith(displayName,'PPM-Accounting Team')"}).value,
true
).id
);
List Group members:
ClearCollect(MembersfromSG,Office365Groups.ListGroupMembers(wAdminID1_1).value)
Response: