Hi @Anonymous
For getting the selected user's name on the second screen:
On Screen 1, set the OnSelect property of the button (the image you're using) to navigate to Screen 2 and pass the selected user's information. Assuming your gallery's selected item is Gallery1.Selected, and it has a field called Name, you’d write something like this:
Navigate(Screen2, {SelectedUserName: Gallery1.Selected.Name})
On Screen 2, use the context variable to populate the name in the desired text label or input. You can set the Text property of the label where you want the name to show up to:
SelectedUserName
For sending a Slack DM using the user’s email:
You’ll need to work with Slack’s API. It’s a bit tricky since you want to map the email to the Slack user ID or username. Here’s a general approach:
Use a Power Automate flow to handle the Slack API interaction. In Power Apps, use the OnSelect property of the send button to call this flow, passing the email of the selected user.
In the flow, you would have an HTTP request to Slack's users.lookupByEmail API to get the user ID associated with the email.
Once you have the user ID, use it in another HTTP request to chat.postMessage to send a DM to that Slack user.
In Power Apps, it would look something like this on the OnSelect property of the send button:
PowerAutomateFlowName.Run(Gallery1.Selected.Email, TextEmailMessage1.Text)