In this article
Overview
Use this Snap to perform the following Channel operations in your Slack workspace:
- Archive channel
- Create channel
- Invite user
- List members
- Remove user
- Rename channel
- Retrieve channel info
- Unarchive channel
Prerequisites
A valid and active account in the Slack workspace.
Slack Scopes required
Any action you want to perform within a Slack workspace, additionally needs appropriate Scopes assigned to your app. See the Scope and Permissions article in Slack API documentation for the complete list and each Account page under Configuring Slack Accounts (Doc in Progress) for information on defining Scopes for your app.
To | Bot Token Accounts | User Token Accounts ( user_scope ) |
---|---|---|
| channels:manage
|
|
| channels:read | channels:read |
Unarchive channel | N/A |
|
Support for Ultra Pipelines
Works in Ultra Pipelines.
Limitations
- Snaps in this Snap Pack use conditional display/hiding of fields. So, ensure that you always use the New Form UI (and not the classic UI) for the Snaps to function as designed/expected.
- Channel operations Archive Channel and Unarchive Channel cannot be performed using a Bot Token account. Use a User Token account instead.
Known Issues
None.
Snap Input and Output
Input/Output | Type of View | Number of Views | Examples of Upstream and Downstream Snaps | Description |
---|---|---|---|---|
Input | Document |
|
| A document containing details required for the selected channel operation. |
Output | Document |
|
| A document containing the result (success/failure) of the selected channel operation. |
Snap Settings
Parameter Name | Data Type | Description | Default Value | Example |
---|---|---|---|---|
Label | String | Specify a name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline. | Channel Operations | Channel Operations |
Operation | Drop-down list | Select an operation from the following list of permitted channel operations and specify the corresponding details needed:
| List Members | Invite User |
Channel | String/Expression/Suggestion | Required for all channel operations except Create Channel. Select a channel from the list of suggested channels to perform the selected channel operation. Alternatively, you can enter the channel name and/or channel ID in one of the following formats.
| N/A | #testprivate:G019B3ETYMB |
Users | String/Expression/Suggestion | Required for channel operation - Invite User. Select a user from the suggested values which are typically the list of users available in the workspace. Alternatively, you can enter one or more usernames and/or user IDs, separated by commas, in one of the following formats:
The specified set of users are invited to join the selected channel. | N/A | @user.name:W01A94P7MK1 |
User | String/Expression/Suggestion | Required for channel operation - Remove User. Select a user from the suggested values which are typically the list of users available in the workspace. Alternatively, you can enter one or more usernames and/or user IDs, separated by commas, in one of the following formats:
The specified user is removed from the selected channel. | ||
Name | String/Expression | Required for channel operation - Create Channel. Enter a name for the new channel. | N/A | Support_Vertical |
Private | Check box | Required for channel operation - Create Channel. Select this check box to keep the new channel private – visible to only members/invitees. | Not Selected | Selected |
New Name | String/Expression/Suggestion | Required for channel operation - Rename Channel. Enter the new name for the channel. | N/A | ReleaseTeam_Channel |
Snap Execution | Drop-down list | Select one of the three following modes in which the Snap executes:
| Execute only | Validate & Execute |
Troubleshooting
Error | Reason | Resolution |
---|---|---|
Unable to rename the given channel. Reason: invalid_name_specials | You have provided an invalid name for renaming the channel. | Ensure that the name provided for the channel is valid (does not contain invalid special characters). |
Unable to kick user from channel. Reason: Channel_not_found | You have specified an invalid channel to remove the user. | Ensure that the user to be removed currently exists in the channel members list. |
Unable to archive channel. Reason: Channel_not_found | You have specified an invalid channel to archive. | Ensure that the channel exists in the workspace and is not archived already. |
Unable to unarchive channel. Reason: Channel_not_found | You have specified an invalid channel to unarchive. | Ensure that the channel exists in the workspace and is archived already. |
Input error. Reason: No Channel provided | You have not specified a channel to perform the selected channel operation. | Ensure that you provide a channel in the Channel field and that it exists in this workspace. |
Examples
Using Channel Operations Snap
This example uses a series of Pipelines to demonstrate the different operations that you can perform on channels using the Channel Operations Snap. All operations carried out in this example are for demonstration purposes only and these Pipelines do not reflect any actual/real-time scenario.
- A Pipeline with two Channel Operations Snaps to create a channel and invite one or more users to it.
- A Pipeline with three Channel Operations Snaps to prename a channel and retrieve users and generic information about the channel.
Example 1: Create a channel and Invite User to join
This Pipeline uses two features of the Channel Operations Snap – Create Channel and Invite User. The first Channel Operations Snap is configured to create a new channel with a unique name defined as an expression. It creates the channel with the name vinchannel48873 and displays its details in the output view.
Channel Operations Snap (Create Channel) | Output |
---|---|
The next Snap invites a user to the new channel. It displays the result of the Invite User operation in the output view.
Channel Operations Snap (Invite User) | Output |
---|---|
Example 2: Rename a channel and view its details and subscribers
This Pipeline uses three features of the Channel Operations Snap – Rename Channel, List Members and Channel Info.
Channel Operations Snap (Rename Channel) | Output |
---|---|
The first Channel Operations Snap is configured to rename the channel generic_edit to generic_edited (for example purposes only). You can see the updated details in the output view. The Snap also retrieves the previous 10 names that the channel was given. The next Channel Operations Snap is configured to retrieve the list of members in the channel.
Channel Operations Snap (List Members) | Output |
---|---|
Based on the channel specified, this Snap returns the list of all members in the channel. You can see the updated details in the output view. The Snap also returns the entire output from the previous Snap, for each member entry retrieved. The next Channel Operations Snap is configured to retrieve details of the channel.
Channel Operations Snap (Channel Info) |
---|
Output |
Based on the channel selected in this Snap, it returns the details of the channel. You can see these details in the output view.
Downloads
Important Steps to Successfully Reuse Pipelines
- Download and import the Pipeline into SnapLogic.
- Configure Snap accounts as applicable.
- Provide Pipeline parameters as applicable.
See Also
- Slack Snap Pack
- Start building Slack apps
- Scopes and Permissions
- Snap Support for Ultra Pipelines
- SnapLogic Product Glossary
- Getting Started with SnapLogic