Afternoon all! Man I love this forum! I'm back to ask only the second question I wasn't able to find an answer by searching already solved materials.
I have a SharePoint list with a User/Group column that is used for in-app permissions and field settings as shown below.
When a specific user is in the list, I am easily able to set a variable for that users permissions. However, when I have a group in the list, the code doesn't work as I'd hope. For instance users in the XYZ_Email_Recipients group don't get the Email permissions provided through the checkmark.
The PA code for setting these variables is shown below.
Set(
varSupervisor,
LookUp(
varSettings,
User.Email = User().Email
).SupervisorGroup
);
Set(
varEmailRecipients,
LookUp(
varSettings,
User.Email = User().Email
).XYZ_Email_Recipients || User().Email in Office365Groups.ListGroupMembers("d18b7a5e-xxxx-yyyy-zzzz-25d5f71cd599").value.mail
);
The top Set() function works great for users, but I had to include the O365.ListGroupMembers function in order to read a users' permissions for the XYZ_Email_Recipients group. If this list contained one or two groups, this wouldn't be too bad to hard-code the guid. However, I have 20+ groups that need to be referenced from this list.
What's the best way to reference permissions when a group is listed in the SharePoint column?
EDIT-1: Since none of my responses are showing up, due to a mod approval I guess, I'll address questions here. No, I don't necessarily want the "group" to have the permissions. What I want is to be able to reference people belonging to the group from within the SharePoint list. The groups will change often so having to keep track of groupid's, or hard-coding a solution, isn't feasible.