# Workato actions for Slack
Workbot actions allow Workbot to post notifications into a specified channel when there are events to take note of, or respond to a command.
Workbot supports 6 actions:
- Post command reply
- Post notifications
- Post message
- Download attachment
- Return menu options
- Upload file
# Block kit compatibility
For more information, see Block kit.
# Post command reply
Post command reply allows you to customize how Workbot replies when an event is completed. This reply can be a simple message about the task completion, or a prompt for the user to take a subsequent action once the first has been done, e.g. after retrieving data for a custom account in Salesforce, ask if the user wishes to copy that information across to another application.
Here is what the Post Command Reply action's output will look like in Slack.
Workbot's post command reply action in Slack
The corresponding action with mapped fields can be found below.
Post command reply action fields mapping
The following table lists the fields available in a Post command reply action.
|Field||Explanation||What goes in here|
|App||The application you are dealing with (e.g. Salesforce, JIRA)||Use the App pill from the Workato Trigger output for this|
|Message text||Message posted in the channel||Whatever you want. Slack Emojis are supported too. This field is optional if you use the Fields input field.|
|Message menu||A drop-down menu in the message posted in the channel||Decide what text to display for each menu option.|
|Title||Title as seen in Slack message||Whatever you want. Slack Emojis are supported too.|
|Title link||Allows you to embed a link in the title||URL of a page you want to be brought to.|
|Message attachments||Detailed message||Whatever you want. Slack Emojis are supported too.|
|Buttons||Buttons will be shown on the message, and you can click them in lieu of typing out another command||
You can define the button label, as well as what command is executed when the button is clicked. You can also choose to pass multiple parameters with this button click e.g. |
|Attachment color||Color displayed with the message to indicate message's importance or type||
Good = Green|
Warning = Amber
Danger = Red
|Attachment Fields||Fields to display in a grid||
One name-value pair per line, e.g.|
Name: Full Name
|Image URL||Attach a picture to the message||URL of an image that will be displayed below the message.|
# Post message
This action will post a message response to a user who invokes a command. The post message action is similar to that of the post command reply, but has more features.
Use post message if you:
Are not using a post command in your trigger step
Want control over who (@username) or where (#channel_name) Workbot should respond to
Want to use advanced features like updating a previous message or posting/updating messages in a thread.
# Channel name/DM
Channel name/DM field allows you post a message in a specified Slack channel or direct message (DM). Use the Channel/DM datapill from a Post command trigger, or key in the channel name e.g. #general or username e.g. @john.
Message to update example
# Advanced section
The advanced section has 2 fields:
Message to update and Thread ID.
# Message to update
Message to update allows you to overwrite a previously posted message from an earlier action step. Simply use the
Message IDdatapill from a Post command trigger, Post message action or Post notification output datatrees.
Message to update example
# Thread ID
Thread ID allows you to post a message within an existing thread in Slack. Simply use the
Thread IDdatapill from a Post message or Post notification output datatree.
Thread ID example
If you don't see Thread ID, make sure it's checked in the 'Add/remove optional fields' section at the bottom of the post message action step:
# Post notifications
This action allows you to define which Slack channel to post customized notifications to. By default, Workbot posts direct messages only to the user who installed Workbot. Note, it is also possible to subscribe from a channel (where Workbot participates) to these notifications.
The fields available are simillar to that of the Post command reply action, with all the typical fields you see in a Slack message. However, there is the addition of the field Notification filter. This field allows you to set parameters for filters, which acts like a trigger filter for sending out notifications (i.e. the notification will only get sent when the set criteria is met).
# Download attachment
This action allows you to download attachments from Slack, received as input to New command trigger. Make sure command parameter for uploaded content has type file, e.g.
attachment type:file. Pass file URL from New command output into the URL field to get attachment content. Then you may further pass this file content to Dropbox, Box or other connectors to upload them as files.
# Return menu options
This action allows you to dynamically generate menu options, then return them to a dynamic menu in a Slack dialog.
For Workbot command recipes that invoke dialogs, a
select field can be defined with dynamic menu options.
A Workbot command recipe with dynamic menu options
After retrieving a list of records from another app (e.g. Salesforce), you can return them back to the dynamic menu by using the Return menu options action.
Retrieving Salesforce opportunities before returning them as menu options back to the Slack dialog with the dynamic menu
Hence, this action should always be paired with a New dynamic menu event trigger.
By default, you can specify a static list of menu options by adding menu options 1-by-1.
Adding static menu options 1-by-1
However, you can create a dynamic list by changing the input mode to dynamic. Simply pass a list datapill from the ouput of a previous action step.
Configuring dynamic menu options
Returned menu options are in an ungrouped list by default.
Ungrouped options in recipe
Ungrouped options in Slack
When returning menu options, you can group menu options together by setting Group menu options? to Yes. This will require you to specify Title of group for each group you add.
Groups options look in recipe
Grouped options in Slack
# Upload file
This action will upload a file to the specified channel, DM or thread. You can also include a simple message together with the file.
A short message before the Chat history.json file
The following table lists the fields available in an Upload file action.
|Field||Explanation||What goes in here|
|Channel name/DM||Upload a file to a specified Slack channel or direct message (DM).||Use the Channel/DM datapill from a Post command trigger, or key in the channel name e.g. #general or username e.g. @johndonahue.|
|Initial comment||Simple message to post together with the uploaded file.||Include a simple message to give more context to your file.|
|File name||Name of your file.||Provide a name for your file, e.g. chat_history.json. This will be the name of the file when any user downloads it from Slack..|
|File type||Type of file||Provide the file type of your file. For the full list of file types which Slack supports, see here.|
|File content||Contents of the file||
Use a Content datapill from the output of preceding action or trigger, e.g. a File contents datapills from a Google Drive Download attachment action.|
|Title||Display title of the file||Displays the title of the file. If left blank, the File name will be displayed instead.|
|Thread ID||Uploads the file within an existing thread||
Use the Thread ID datapill from the output datatree of a Post message or Post command reply to upload the file to an existing thread. |
If no thread exists yet, use the Message ID datapill instead. This will create a new thread for the uploaded file.