Create A Slack Channel Using Flow

Create A Slack Channel Using Flow

Last Updated on December 7, 2022 by Rakesh Gupta

Big Idea or Enduring Question:

  • How do you create a Slack Channel using Salesforce Flow?

Slack Channels bring order and clarity to work — you can create them for every project, topic, or team. When there’s a channel for everything, you can focus on the conversations and work that matters most to you.

I have written a few articles on Slack and Flow. Why not check them out while you are at it?

  1. Post a Message to a Slack Channel using Flow
  2. Send A Direct Slack Message Using Flow


After reading this blog, you’ll be able to: 

  • Understand when to use Run Asynchronous path
  • Make external callouts via Flow
  • Work with SUBSTITUTE, LOWER, and LEFT formulas in the flow  
  • Create a Slack Channel using the flow
  • and much more

Business Use Case

Martin Jones is working as a System Administrator at Gurukul on Cloud (GoC). GoC wants to create a new slack channel when an account is created with rating Hot. GoC wants to follow the naming convention for the Slack channel:

  • account-{use the first 20 characters of the account name) 
    • For example, if the account name is the University of Arizona, then the channel name must be account-account-university-of-arizon
  • Store newly created slack channel Id in a custom field on Account.


  1. The first step is to complete Salesforce for Slack integration.
  2. The second step is to install Sales Cloud for Slack in your Slack workspaces.
  3. Substitutes formula is used to replace old text in a text string with new text.
  4. The left formula returns the specified number of characters from the beginning of a text string.
  5. The lower formula converts all letters in the specified text string to lowercase.
  6. Channel names must be lowercase, without spaces or periods, and can’t exceed 80 characters.

Automation Champion Approach (I-do):

Add an asynchronous path to an After-save Record-Triggered Flow flow to integrate with an external system and update external objects without writing code. The asynchronous path runs after the original transaction for the triggering record is successfully committed. For example, use an asynchronous path to post a message to Slack, update a record in Heroku, or place an order using a third-party fulfillment system.

Before discussing the solution, let me show you a diagram of a Process Flow at a high level. Please spend a few minutes going through the following Flow diagram and understanding it.

Let’s begin building this automation process.

Guided Practice (We-do):

There are 5 steps to solve Martin’s business requirement using Record-triggered Flow. We must:

  1. Create a custom field on the account to store Channel Id
  2. Define flow properties for record-triggered flow
  3. Create a formula to construct the slack channel name
  4. Add Create Slack Channel action – to create a Slack Channel  
  5. Add an Update Records element to update the Slack Channel Id on Account custom field

Step 1: Create a Custom Field on the Account Object to Store Slack Channel Id

Let’s create a custom field on the account object to store the newly created Slack Channel Id.

  1. Click Setup.
  2. In the Object Manager, type Account.
  3. Select Fields & Relationships, then click New.
  4. Select Text as Data Type, then click Next.
  5. Enter Field Label and click the tab key, the Field Name will populate. 
    1. Enter the details:
      1. Length 80
      2. As a best practice, always input a description and Help Text. 
      3. Click on the Next button.
  6. Set the Field-level Security for the profiles 
  7. Add this field to Page Layout.
  8. Click Save.

Step 2: Define Flow Properties

  1. Click Setup.
  2. In the Quick Find box, type Flows.
  3. Select Flows, then click on the New Flow.
  4. Select the Record-Triggered Flow option, click on Create 
    1. Object: Account
    2. Trigger the Flow When: A record is created
    3. Set Entry Condition
      1. Condition Requirements: All Conditions Are Met (AND)
        1. Row 1
          1. Field: Rating
          2. Operator: Equals 
          3. Value: Hot
    4. Optimize the Flow For Action and Related Records
    5. Choose the Option to Include a Run Asynchronously path to access an external system after the original transaction for the triggering record is successfully committed.
  5. Click Done.

  1. Asynchronous paths are available for record-triggered flows that run after the record is saved.
  2. Asynchronous paths options are only available for flow those are configured to run only when a record is updated to meet the condition requirements or select the Is Changed operator in a condition. 
  3. When a new or updated record triggers your flow to run, an asynchronous path is queued until it runs. You can monitor an asynchronous path on the Time-Based Workflow page in Setup.

Step 3: Formula to Construct the Slack Channel Name

  1. Under Toolbox, select Manager, then click New Resource to construct the Slack channel name using substitute formula. 
  2. Input the following information:
    1. Resource Type: Formula
    2. API Name: forT_ChannelName
    3. Data Type: Text
    4. Formula: “account” & “-” & SUBSTITUTE(LOWER(LEFT({!$Record.Name}, 20)), ” “, “-“)
  3. Click Done.

Step 4: Add Create Slack Channel – to create a Slack Channel 

Now we will use the Create Slack Channel action to create a new Slack channel. 

  1. On Flow Designer, under the Run Asynchronously path, click on the +icon and select the Action element.
  2. Search and select the Create Slack Channel from the dropdown menu
  3. Enter a name in the Label field; the API Name will auto-populate.
  4. Set Connection Values for Slack
    1. Slack App: Sales Cloud for Slack
    2. Slack Workspace: Automation Champion
    3. Execute Action As: Slack App
  5. Set Slack Channel Details
    1. Slack Channel Name: {!forT_ChannelName}
    2. Channel Type: Public
    3. Slack Workspace ID for Channel: Automation Champion
  6. Advanced
    1. Manually assigned variables: Selected
    2. Slack Channel ID: {!varT_ChannelId}
  7. Click Done.

Step 5: Adding an Update Records Element to Update the Slack Channel Id on Account’s Custom FIeld

The next step is to update the newly created Slack Channel Id on Account. We will use the Update Records element. 

  1. On Flow Designer, click on the +icon and select the Update Records element.
  2. Enter a name in the Label field; the API Name will auto-populate.
  3. For How to Find Records to Update and Set Their Values select Use the account record that triggered the flow.
  4. Select None – Always Update Record
  5. Set Field Values for the Account Record
    1. Row 1:
      1. Field: Slack Channel Id
      2. Value: {!varT_ChannelId}
  6. Click Done.

In the end, Martin’s Flow will look like the following screenshot:

Once everything looks good, perform the steps below: 

  1. Click Save.
  2. Enter Flow Label; the API Name will auto-populate.
  3. Click Show Advanced.
  4. API Version for Running the Flow: 55
  5. Interview Label: Create A Slack Channel Using Flow  {!$Flow.CurrentDateTime}
  6. Click Save.

Almost there! Once everything looks good, click the Activate button.

Proof of Concept

Now onwards, if a business user creates a new account with a rating hot, record-triggered after-save will automatically create a new Slack channel.

  1. Navigate to the Account a new account Universal Health Services, as shown in the following screenshot:
  2. Now login to Slack and check out the Slack channel.
  3. Slack Channel Id is stored in the custom field on account.

Formative Assessment:

I want to hear from you!

What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? Feel free to share in the comments below.

Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

13 thoughts on “Create A Slack Channel Using Flow

  1. Thanks a lot for this amazing article,
    Just wanted to ask, is it possible to get slack channel id of this created channel when we want to archive this channel?

  2. Any idea how to use the installed flow Create Opportunity Sales Channel flow to create channel that would then show on the Opportunity related list of Sales Channels? The flow that is installed with the Sales Cloud for Slack app is empty. There is a button for ‘Link to Sales Channel’, but I want that created automatically based on criteria.

    1. One option is to save the channel Id on the Opportunity record. Otherwise, use the Message Destination object to query. Let me know if you find another workaround/solution for it. Thank you!

  3. This article really helps, but I’m looking for more.. wondering if that’s possible.

    To explain: I’ve build a custom object with 2 fields related to users, for example ‘owner’ and ‘approver’.

    When the record status changes from X to Y, I want to automate a trigger where a Slack channel is created and where both users are added.

    Curious to hear from you if this is possible as well!

  4. Hi thank you for this amazing article
    is it possible to automate a slack workspace creation? or only a channel?


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.