Hi @DLCaterhamSch ,
Use this Formula:
// Initialize both variables to false
Set(VarOnbehalf, false);
Set(VarHideShowHolidayCateringRequest, false);
// Check membership for Group 2
If(
CountRows(
Filter(
Office365Groups.ListGroupMembers("Group 2").value,
Lower(mail) = Lower(User().Email)
)
) > 0,
Set(VarOnbehalf, true)
);
// Check membership for Group 1
If(
CountRows(
Filter(
Office365Groups.ListGroupMembers("Group 1").value,
Lower(mail) = Lower(User().Email)
)
) > 0,
Set(VarHideShowHolidayCateringRequest, true)
);
// You can now use VarOnbehalf and VarHideShowHolidayCateringRequest to control visibility or other properties
lace this code in the OnVisible property of the screen where you want these checks to occur. This code initializes two separate variables, VarOnbehalf and VarHideShowHolidayCateringRequest, to false. It then checks the membership of the current user in "Group 2" and "Group 1" respectively, setting the variables to true if the user is a member.
You can then use these variables (VarOnbehalf and VarHideShowHolidayCateringRequest) to control the visibility of different UI elements based on the group membership.
Remember to replace "Group 1" and "Group 2" with the actual IDs of your groups.
Best Regards,
Hassan Raza