I'm building an app that displays a user gallery of upcoming birthdays and work anniversaries based on a SharePoint list. I've got that working just fine.
My next step is to have an image that functions as a button (see Screen 1 below). This button opens a new screen where the user can send a message via Slack to the selected colleague from the previous screen. There are two things I'm trying to figure out:
Screen 1:
Screen 2:
Current Slack formula being used in the OnSelect field of the paper airplane icon in Screen 2. I want to replace #larissa-test-channel with a dynamic value based on the selected user.
Slack.PostMessage("#larissa-test-channel", Text(TextEmailMessage1), {as_user:true})
Thanks!
Thanks so much! I got those first two parts working great.
I'm already using a flow to generate my SharePoint list of users with birthdays listed in their Delve profile. I wonder if I could add a step using your suggestion for the Slack API, but then put their user ID in a new column of the SharePoint list. If I can manage this, then I could pull that into the app for the post message action.
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)
MS.Ragavendar
32
Rajkumar_M
16
Super User 2025 Season 1
mmbr1606
14
Super User 2025 Season 1