Messages
Create, update, delete, and query the available messages in Slack.
Table Specific Information
Select
The add-in 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 add-in.
- ChannelId supports the = operator.
- SearchTerm supports the = operator.
- CreatedTime supports the <,>,>=,<=,= operator.
Note: The Messages table requires ChannelId or SearchTerm in the WHERE clause. In the case of a simple select, the Slack automatically adds the ChannelId where the current user is a member of the channel to the WHERE clause.
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')
Update
The Messages table allows updates only for the Text field. Specify ChannelId and Id.
UPDATE Messages SET Text = 'Updated message' WHERE ChannelId = 'D71R6CSR1' AND Id = '1234567890.123456'
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 | Description |
| Id [KEY] | String | True |
The Id of the message. |
| ChannelId [KEY] | String | False |
The Id of the channel the message was posted to. |
| UserId | String | True |
The Id of the user that posted the message. |
| Text | String | False |
Text of the message. |
| Type | String | True |
Type of the message. |
| Item_type | String | True |
Item type of the message. |
| Subtype | String | True |
Subtype of the message. |
| Team | String | True |
Team of the message. |
| Pinned_to | String | False |
Pinned details of the message. |
| Pinned_info_Channel | String | True |
Id of the pinned channel of the message. |
| Pinned_info_pinned_by | String | True |
Id of the pinned by message. |
| Pinned_info_pinned_ts | String | True |
Id of the pinned message of the message. |
| AttachmentsAggregate | String | True |
Attachments made to the message. |
| Purpose | String | False |
Purpose of the message. |
| BotId | String | True |
BotId of the message. |
| BotLink | String | True |
BotLink of the message. |
| Username | String | True |
UserName of the message. |
| Reply_count | Integer | False |
Count of the replied channels to the message. |
| Reply_users_count | Integer | False |
Count of the replied users to the message. |
| Latest_reply | String | True |
Latest message reply of the message. |
| Last_read | String | True |
Last read message. |
| Reply_usersAggreagte | String | True |
Replied user details of the message. |
| Subscribed | Boolean | True |
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. |