Messages
Create, update, delete, and query the available messages in Slack.
Table-Specific Information
SELECT
The provider uses the Slack API to filter the results by the following columns and operators while the rest of the filter is executed client-side within the provider.
- ChannelId supports the = operator.
- SearchTerm supports the = operator.
- CreatedTime supports the <,>,>=,<=,= operators.
Note: The Messages table requires either ChannelId or SearchTerm in the WHERE clause. For a simple SELECT statement, Slack automatically adds a ChannelId condition for channels in which the current user is a member.
SELECT * FROM Messages WHERE ChannelId = 'D71R6CSR1'
SELECT * FROM Messages WHERE SearchTerm = 'text'
SELECT * FROM Messages WHERE CreatedTime >= '7-30-2023 00:00:00' AND CreatedTime <= '8-4-2023 00:00:00'
INSERT
Slack allows inserts only when ChannelId and Text are specified.
INSERT INTO Messages (ChannelId, Text) VALUES ('D71R6CSR1', 'This is a message')
To optionally post the message text as Markdown, include the IsMarkdownText pseudo-column and set it to true. For example:
INSERT INTO Messages (ChannelId, Text, IsMarkdownText) VALUES ('C01KWCPJJ69', '**This is bold text**', true)
If IsMarkdownText is set to false or not provided, the message is treated as normal text.
UPDATE
The Messages table allows updates only for the Text field. Specify the ChannelId and Id to update.
UPDATE Messages SET Text = 'Updated message' WHERE ChannelId = 'D71R6CSR1' AND Id = '1234567890.123456'
To optionally update the message text as Markdown, include the IsMarkdownText pseudo-column and set it to true. For example:
UPDATE Messages SET Text = '**This is bold text**', IsMarkdownText = true WHERE ChannelId = 'C01KWCPJJ69' AND Id = '1770731565.511059'
If IsMarkdownText is set to false or not provided, the message is treated as normal text.
DELETE
Messages can be deleted by providing the ChannelId and the Id of the message.
DELETE FROM Messages WHERE ChannelId = 'D71R6CSR1' AND Id = '1234567890.123456'
Columns
| Name | Type | ReadOnly | References | Description |
| Id [KEY] | String | True |
The Id of the message. | |
| ChannelId [KEY] | String | False |
Channels.Id |
The Id of the channel the message was posted to. |
| UserId | String | True |
Users.Id |
The Id of the user that posted the message. |
| Text | String | False |
The text of the message. | |
| Type | String | True |
The message type. | |
| Item_type | String | True |
The item type of the message. | |
| Subtype | String | True |
The item subtype of the message. | |
| Team | String | True |
The team of the message. | |
| Pinned_to | String | False |
The pinned details of the message. | |
| Pinned_info_Channel | String | True |
The Id of the pinned channel of the message. | |
| Pinned_info_pinned_by | String | True |
The Id of the pinned by message. | |
| Pinned_info_pinned_ts | String | True |
The Id of the pinned message of the message. | |
| AttachmentsAggregate | String | True |
The attachments made to the message. | |
| Purpose | String | False |
The purpose of the message. | |
| BotId | String | True |
The BotId of the message. | |
| BotLink | String | True |
The BotLink of the message. | |
| Username | String | True |
The UserName of the message. | |
| Reply_count | Integer | False |
The count of the replied channels to the message. | |
| Reply_users_count | Integer | False |
The count of the replied users to the message. | |
| Latest_reply | String | True |
The latest message reply of the message. | |
| Last_read | String | True |
The last read message. | |
| Reply_usersAggreagte | String | True |
The replied user details of the message. | |
| Subscribed | Boolean | True |
The subscribed status of the message. | |
| Topic | String | True |
Topic of the message. | |
| Old_name | String | False |
Old Name of the message. | |
| Name | String | False |
Name of the message. | |
| SearchTerm | String | True |
Filter by this column to retrieve all messages that contain the word in the criteria. | |
| UserEditedDate | String | True |
The date of the edited message. | |
| UserEditedId | String | True |
The user Id of the edited message. | |
| CreatedTime | Datetime | True |
The created date time of the message. | |
| ItemURL | String | True |
The URL of the item. | |
| Files | String | True |
The files associated with the message. | |
| Blocks | String | True |
The blocks associated with the message. | |
| Reactions | String | True |
The reactions associated with the message. | |
| Upload | Boolean | True |
Indicates whether the file is uploaded. | |
| ClientMsgId | String | True |
The Id of the Client Message. | |
| IsLocked | Boolean | True |
Indicates whether the message is locked. | |
| AppId | String | True |
The App Id of the Slack app. | |
| DisplayAsBot | Boolean | True |
Indicates whether to display the message as a bot. | |
| ParentMessageId | String | True |
The parent message Id. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer more granular control over the data returned from the data source.
| Name | Type | Description |
| IsMarkdownText | Boolean |
Indicates whether the text is in markdown format. |