@_sourcecod3_
Yes, you can try to conditionally show/hide a button based on the current user's group membership in SharePoint.
However, Power Apps itself doesn't really have a direct formula to fetch SharePoint group membership of the current user to my awareness.
You would need to instead, create a flow in Power Automate that gets the SharePoint group membership and then call this flow from Power Apps.
Here's how you could do this:
1. Create a flow in Power Automate:
a. The trigger should be PowerApps (V2)
b. Add a Send an HTTP request to SharePoint action. Site Address is your SharePoint site URL. Method should be GET. Uri is _api/web/currentuser/groups.
c. Parse the JSON result to get the group titles. Add a Parse JSON action. Content is body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']. Schema can be generated from a sample payload, which you can get by running the HTTP request in a browser.
d. Initialize an array variable. Loop over the parsed results using Apply to each, and add the group titles to the array using Append to array variable.
e. Finally, add a Respond to a PowerApp or flow action and provide the array variable as input.
2. In Power Apps, call the flow and get the result:
a. On App start, use ClearCollect(colUserGroups, YourFlowName.Run()) to run the flow and store the returned groups in a collection.
b. Use the in operator to check if 'Owners' is in the returned groups. The Visible property of the button would be: 'Owners' in colUserGroups.
Please note that the flow runs with the permissions of the current user, so it can only see the groups that the user has permissions to see.