Example Slack request
Learn how to use Slack requests in your actions.
In this tutorial, we'll take a closer look into designing actions with Slack requests and dynamically generate request parameters from input and request components.
Deal room action
For example, one of your sales team member is about to close an important deal and the customer has some questions regarding their billing and subscription. The situation requires a finance team expertise in collaboration with sales team.
We'll design an action that automatically creates a Slack channel with the entered deal name and invites selected users to this channel. Let's see how to configure this action.
Go to your apps App settings tab and add a new Slack connection. Select your Slack workspace.
Create an action. You can name it
Deal room
.Create a new input component:
deal_name
. It is a text input.Add another input
Slack_users
. It is a multi select component.Add a new Slack request. Select List Slack users method and give
ListSlackUsers
name to your request. Then, select your Slack connection.Go to
Slack_users
input and add below values to display and identifier fields:Display:
{{request.ListSlackUsers.response.users.map(u=>u.name)}}
Identifier:
{{request.ListSlackUsers.response.users.map(u=>u.id)}}
Add a new Slack request. Select Create channel method and give
CreateChannel
name to your request. Then, select your Slack connection.Next, enter below to Channel name:
{{input.deal_name.replace(' ', '-').toLowerCase()}}
The channel's name will be dynamically generated from the entered deal name. Since Slack channel names can not contain spaces, we applied
.replace()
method that replace any space in deal name with a dash.You can select Public for Channel type.
Add a new Slack request. Select Invite users to channel method and give
InviteUsersToChannel
name to your request. Then, select your Slack connection.Next, go to Channel field and click gear button near it. Select Dynamic option and enter below:
Channel:
{{request.CreateChannel.response.channel.id}}
Channel's value will be dynamically generated from the response of
CreateChannel
request.Next, go to Users field and click gear button near it. Select Dynamic option and enter below:
Users:
{{input.Slack_users}}
Users field's value will be the values selected in
Slack_users
input.Add
CreateChannel
andInviteUsersToChannel
Slack requests to Run steps on Inputs tab.Apply changes to your action. Make sure to mark it as Enabled while applying changes.
Test your action or run in Slack to see how it works.
Go to the channel created by Actioner in your Slack workspace.