I'm trying to figure out how to disable/enable a button based on a Azure AD security group. Where it will check on start if that user is apart of the security group and show the button if they are and vice versa if they arent...

I'm trying to figure out how to disable/enable a button based on a Azure AD security group. Where it will check on start if that user is apart of the security group and show the button if they are and vice versa if they arent...
On App Start:
ClearCollect(
AzureADGroup,
AzureAD.GetGroupMembers("group ID")
);
Set(
VariableName,
IsEmpty(
Filter(
CollectionName,
User().Email in value.userPrincipalName
)
)
);
Then on the button if variable is true, then enable else disable.
Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful because this can help others.
LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
Twitter: https://twitter.com/phipps0218