Archive A Slack Channel Utilizing Circulation

Final Up to date on December 5, 2022 by Rakesh Gupta

Massive Thought or Enduring Query:

  • How do you Archive a Slack Channel utilizing Salesforce Circulation?

Slack Channels deliver order and readability to work — you may create them for each challenge, matter, or staff. When there’s a channel for every part, you may give attention to the conversations and work that issues most to you.


I’ve written just a few articles on Slack and Circulation. Why not verify them out if you are at it?

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

On this weblog publish, I’ll go a step additional and provide help to to know the way to archive slack channels utilizing circulate. Earlier than studying this text, make sure you’ve learn Create A Slack Channel Using Flow article.


After studying this weblog, you’ll have the ability to:  

  • Perceive when to make use of Run Asynchronous path
  • Make exterior callouts by way of Circulation
  • Use the choice component to verify the account’s fields worth 
  • Archive a Slack Channel utilizing the circulate
  • And rather more

Martin Jones is working as a System Administrator at Gurukul on Cloud (GoC). Just lately GoC carried out the auto-creation of a Slack Channel for a brand new account. Now GoC’s higher administration desires to implement an auto-archival course of for the account’s Slack channel: 

  • If an account is marked as out-of-business (which may be recognized by means of a checkbox area on the Account title, Out of Enterprise).


  1. Step one is to implement Create A Slack Channel Using Flow.

Automation Champion Strategy (I-do):

Add an asynchronous path to an After-save Document-Triggered Circulation circulate to combine with an exterior system and replace exterior objects with out writing code. The asynchronous path runs after the unique transaction for the triggering file is efficiently dedicated. For instance, use an asynchronous path to publish a message to Slack, replace a file in Heroku, or place an order utilizing a third-party achievement system.

Earlier than discussing the answer, let me present you a diagram of a Course of Circulation at a excessive degree. Please spend a couple of minutes going by means of the next Circulation diagram and understanding it. Let’s start constructing this automation course of.

Guided Apply (We-do):

There are Four steps to resolve Martin’s enterprise requirement utilizing Document-triggered Circulation. We should:

  1. Create a customized checkbox area (Out of Enterprise on Account) 
  2. Outline circulate properties for record-triggered circulate
  3. Add a Determination component to verify Slack Channel Id area
  4. Add Archive Slack Channel motion

Step 1: Create a Custome Discipline – Out of Busines 

  1. Click on Setup.
  2. Within the Person Interface, clicks on Object Supervisor.
  3. Navigate to Account | Fields & relationships and click on on the New button.
  4. Click on on the Checkbox information sort.
  5. Enter Discipline Label the Discipline Title will auto-populate. 
  6. Click on on the Unchecked for the Default Worth.
  7. Add a area on the Web page Structure and grant area entry to the specified profiles. 
  8. Click on Save.

Step 2: Outline Circulation Properties

  1. Click on Setup.
  2. Within the Fast Discover field, sort Flows.
  3. Choose Flows, then click on on the New Circulation.
  4. Choose the Document-Triggered Circulation possibility, click on on Create 
    1. Object: Account
    2. Set off Alternative Circulation When: A file is created or Up to date
    3. Set Entry Standards
      1. Situation Necessities: All Situations Are Met (AND)
        1. Row 1
          1. Discipline: Out_of_Business__c
          2. Operator: Equals 
          3. Worth: {!$GlobalConstant.True}
    4. When to Run the Circulation for Up to date Information: Solely when a file is up to date to satisfy the situation necessities.
    5. Optimize the Circulation For Motion and Associated Information
    6. Select the Choice to Embody a Run Asynchronously path to entry an exterior system after the unique transaction for the triggering file is efficiently dedicated.
  5. Click on Completed.

Keep in mind
  1. Asynchronous paths can be found for record-triggered flows that run after the file is saved.
  2. Asynchronous path choices are solely out there for flows which might be configured to run solely when a file is up to date to satisfy the situation necessities or choose the Is Modified operator in a situation. 
  3. When a brand new or up to date file triggers your circulate to run, an asynchronous path is queued till it runs. You’ll be able to monitor an asynchronous path on the Time-Primarily based Workflow web page in Setup.

Step 3: Utilizing Determination Aspect to Examine Slack Channel Id Customized Discipline on Account

Now we’ll use the Determination component to verify whether or not the account’s Slack Channel Id area is populated. If the sphere is just not populated, we won’t take additional motion. 

  1. On Circulation Designer, underneath the Run Asynchronously path, click on on the +icon and choose the Determination component.
  2. Enter a reputation within the Label area; the API Title will auto-populate.
  3. Beneath Final result Particulars, enter the Label the API Title will auto-populate.
  4. Situation Necessities to Execute Final result: All Situations Are Met (AND)
    1. Row 1:
      1. Useful resource: {!$Document.Slack_Channel_Id__c}
      2. Operator: Is Null
      3. Worth: {!$GlobalConstant.False}
  5. When to Execute Final result: If the situation necessities are met
  6. Click on Completed.

Step 4: Add Archive Slack Channel Motion 

Now we’ll use the Archive Slack Channel motion to archive the account’s Slack channel. 

  1. On Circulation Designer, beneath the Sure node, click on on the +icon and choose the Motion component.
  2. Search and choose the Archive Slack Channel from the dropdown menu
  3. Enter a reputation within the Label area; the API Title will auto-populate.
  4. Set Connection Values for Slack
    1. Slack App: Gross sales Cloud for Slack
    2. Slack Workspace: Automation Champion (Your Slack Workspace) 
    3. Execute Motion As: Slack App
  5. Set Slack Channel Particulars
    1. Slack Channel Id: {!$Document.Slack_Channel_Id__c}
  6. Click on Completed.

In the long run, Martin’s Circulation will seem like the next screenshot:  

As soon as every part appears good, carry out the steps beneath: 

  1. Click on Save.
  2. Enter Circulation Label; the API Title will auto-populate.
  3. Click on Present Superior.
  4. API Model for Working the Circulation: 56
  5. Interview Label: Archive A Slack Channel Utilizing Circulation  {!$Circulation.CurrentDateTime}
  6. Click on Save.

 Nearly there! As soon as every part appears good, click on the Activate button.

Proof of Idea

Now onwards, if a enterprise person creates a brand new account with a score scorching, record-triggered after-save will robotically create a brand new Slack channel.

  1. Navigate to the Account new account Jardine Matheson Ltd, as proven within the following screenshot:
  2. Now login to Slack and take a look at the Slack channel.
  3. Slack Channel Id is saved within the customized area on the account.
  4. Subsequent time, when a person updates the account Out_of_business__C to True, as proven within the following screenshot:
  5. Document-triggered circulate robotically archives the account’s Slack Channel.

Formative Evaluation:

I need to hear from you!

What’s one factor you discovered from this publish? How do you envision making use of this new data in the actual world? Be happy to share within the feedback beneath.

Source link

Thanks for Reading

Enjoyed this post? Share it with your networks.

Leave a Feedback!