Salesforce + Slack = Awesomeness ❤️

Sombir Sheoran
10 min readAug 7, 2022

--

Integrating Salesforce with Slack — Slack is where the future works

Note: The Slack package is compatible with the Salesforce Lightning and Classic Experiences, and supports Sales Cloud and Service Cloud. This blog post helps you understand how the two systems:

Salesforce and Slack integration is the collaboration in the best possible ways.

Integrating Salesforce with Slack — Slack is where the future works

How it works in Layman’s terms ⚙️

Knowing your integration better

Salesforce AppExchange is a Marketplace for Salesforce applications and Slack App Directory is a Marketplace for Slack applications.

In Simple terms, the user should install the Slack App on the Salesforce and the Salesforce app on the Slack platform, in order to build a seamless experience between the two systems.

Let’s have a closer look on : Who does what?

The role for each app: Who does what?

Major steps involved to get this Integration working are:

Install and configure the Slack app for Salesforce

Install the Salesforce app to Slack

Connect your Salesforce and Slack accounts using these apps

* Install and configure the Slack app for Salesforce

The pre-requisites to this step is that you must have a custom domain enabled in your org. A fresh trailhead playground is recommended, which comes ready with a custom domain.

  • From the Trailhead playground, launch the ‘Playground Starter’ app and click on the Install a package tab. Search for 04t4P000002OxMvQAK in the package ID and install it in your Salesforce org.
  • Alternatively, get it installed from the Salesforce AppExchange for Production and other Sandboxes.
Install Salesforce for Slack
Install Salesforce for Slack
Verify installation under Setup > Installed Packages
Verify installation under Setup > Installed Packages

Granting user permissions :

Once the package is installed, to make sure, only the authorized users are granted access to use this Slack package, we provide the required access by granting the necessary permissions to the required list of users:

  • From set-up, search for permission set: Slack Standard User
Slack Standard User — Permission set
  • Click on Manage Assignments and then Add Assignments
  • Assign to your System Administrator profile user (and later can be assigned to team members once it is working) and click Done.

* Install the Salesforce app to Slack

  • Go to the Slack App Directory
  • From the left-hand side, click on Sign in to Install
  • Log in to your Slack workspace (please use the details mentioned in the <Automate your Slack Messages> step on this page.). You need a Slack login account to make this happen.
  • Once successfully installed, you see Salesforce under the Apps within the Slack workspace.
  • You can click on the Salesforce app to see all possible configurations, Setup my alerts, Disconnect accounts, add channel alerts and slack commands [type /salesforce] in a channel to setup alerts or add bulk-alerts
Salesforce setup within Slack app
Salesforce setup within Slack app
  • Set up my alert for the required set of objects
Set up my alerts in Salesforce app on Slack
Set up my alerts in the Salesforce app on Slack
  • Go to the About tab to make all possible configurations your team needs with this app
Salesforce app configuration in Slack
Salesforce app configuration in Slack
  • /salesforce command helps you to search anything within Slack from Salesforce
/salesforce command
/salesforce command
  • Look at all the possible search results, and Object wise and click on View record to view it directly within the Slack app, without navigating to Salesforce. Wow 😮
/salesforce command search results
/salesforce command search results
  • Try other possible features and mention them in the comments sections for everyone’s help :)

* Connect your Salesforce and Slack accounts using these apps

Authorizing the Slack app

  • From the App launcher, search for the Slack Setup app and launch it.
Slack Setup app
Slack Setup app
  • And then click Get Started to authorize it. This is a one-time activity.
click Get Started to authroize it.
Click Get Started to authorize it.
  • Allow it to permit access to your trailhead playground. Once access is granted to the trailhead playground, you will see org. as Connected
see org. as Connected
see org. as Connected
  • For time being, we can click on Finish as we would be using only the allowed Standard objects in this thread. If we need to allow access to custom objects as well for collaboration between the two systems, this app requires further setup, which is not in the scope of this setup.
options to configure the Slack settings
options to configure the Slack settings

Setup the Slack app for Custom alerts

Custom alerts are like topics in the newsfeed. So, instead of sending the full feed to someone, we should send the information that’s important to any Sales or Service team. Let’s consider a scenario where only the Closed-won opportunities are to be communicated to the Sales team. Let’s create our first custom alerts in the Slack app:

Custom Alert types:

Object level : An alert that is sent when any record of the selected object type meets the specified criteria.

Record level: An alert that is sent when an individual record of the selected object type meets the specified criteria.

  • Click Continue on the Slack app, Skip Enable Custom Objects for now, and again click Continue. Click now to create a new custom alert (Record level), add Criteria as mentioned below, and click Save:
Closed Won Opportunities Custom Alert
Closed Won Opportunities Custom Alert
Closed Won Opportunities Custom Alert — Criteria
Closed Won Opportunities Custom Alert — Criteria
  • We’ve our newly created custom alert ready:
Newly created Custom alert for Opportunities
Newly created Custom alert for Opportunities

Adding Slack actions: Org Configuration

Two types of Slack actions are available: Send to Slack and Slack Alerts.

  • Send to Slack lets you send messages and records from Salesforce into Slack. For example, a user can send the contact information for a lead to a colleague.
  • Slack Alerts lets you customize automated alerts for Salesforce record changes in Slack channels, such as when someone tags a colleague as a new sales lead, changes the status of a lead, or converts a lead. This helps ensure that everyone working on the project stays notified without needing to switch back and forth between Salesforce and Slack or send follow-up messages to notify your team members of changes.

You can add the Send to Slack action to individual page layouts, or to global layouts so it’s visible on all pages. You can also add Slack Alerts to set up record-level alerts.

  • In the Slack Setup app, System Connections, Enable Custom Objects, and Custom Alerts should be complete. Click Continue to head into Org Configuration
  • Select Opportunity & Leads related Layouts (can do whatever objects you want though) and click on Add actions to Layouts and wait to finish it
Opportunity and Lead : Add Slack Actions to Layouts
Opportunity and Lead: Add Slack Actions to Layouts
Confirmation
Confirmation
  • Click Next to Add Slack Message Viewer Component to Pages to repeat the same and at the end, click Finish

Automate your Slack Messages

Pre-requisites : You need a Slack account (Free Trial available) and a Slack workspace ready in order to communicate between Salesforce and Slack.

  • Launch https://slack.com/ and either Sign-in with an existing account or start a free trial and then create a Slack workspace with self-explanatory steps.
create a Slack workspace
create a Slack workspace
  • Once your Slack workspace is ready with the required details, it should look something like this:
Salesforce — Slack — Talks : Our working Workspace
Salesforce — Slack — Talks: Our working Workspace
  • Creating a channel for communication: Click on Workspace (Drill down arrow) > create a channel: We have the sfdc-slack-integration channel. You may toggle on the option to auto-add anyone who joins your workspace.
Creating a channel
Creating a channel
  • Now, head back to your Trailhead Playground to finish the setup from the Slack app.

Slack app: Create Custom Message Destinations

Custom message destinations guide alerts to your specific Slack workspace(s).

  • The app should indicate Automation Configuration is next. Click Continue to start
Automation Configuration in Slack App
Automation Configuration in Slack App
  • Click Sign in with Slack to open the popup and authenticate your Slack workspace which you just created in previous steps, Allow if needed.
Salesforce connecting to Slack workspace
Salesforce connecting to Slack workspace
  • Once logged in with Slack workspace, Click New Message Destination and enter the following, by selecting your Slack workspace and newly created channel, click Save once done.
New Message Destination : Slack app
New Message Destination: Slack app

Important note: Copy the message destination ID, note it somewhere it would be used in upcoming steps for automation, for this instance, value is: a03Iw000000rdUTIAY [This would vary for each record you create.]

Copy the message destination ID
Copy the message destination ID

Building Automation with Process Builder

  • Go to Set-up > Process builder > Create a new Process builder on Opportunity object with no entry criteria.
  • Add below Action with Action Type: Apex, Apex Class: Slack: Post Message, and set below Apex variables:
  • Message Destination ID | ID | enter the destination ID you copied from your message destination above, here use a03Iw000000rdUTIAY
  • Record ID | Field Reference: Opportunity ID
  • Click Add Row : Message: String: Congrats, New Opportunity in Salesforce
Slack — Opportunity Process Builder for automation
Slack — Opportunity Process Builder for automation
  • Finally, Save and Activate the above process builder.
Final Process Builder looks like this.
Final Process Builder looks like this.

Finally, testing the Integration between Salesforce & Slack

  • Go to the Sales app, then go to Opportunities and create a new Opportunity record in Salesforce, and Voila! Congratulations 🥳 🎉, your new Opportunity record updates went automatically to the Slack workspace channel: sfdc-slack-integration
Successfull integration between Salesforce and Slack
Successful integration between Salesforce and Slack
  • A Closure look at the Opportunity record being displayed within Slack with the Slack: Post message, message = Congrats, New Opportunity in Salesforce as configured in previous steps.
  • Also, it shows main fields like Owner, Close Date, and Opportunity Stage within Slack. This looks amazing.
  • No need to login into the Salesforce app and you can see the Salesforce record within the Slack app. No need to switch between the two apps, Salesforce and Slack.
  • Sales agent’s productivity goes sky-rocketed 🚀
Important note
Important note
  • Observe the Send to Slack and Slack Alerts buttons added to the Opportunity record page. These were added to Opportunity / Leads layouts during our Slack-app setup steps.
Send to Slack and Slack Alerts buttons added to Opportunity record page
Send to Slack and Slack Alerts buttons added to Opportunity record page
  • Click on Slack Alert to see all standard Slack alerts options available on the Opportunity standard object. This option will vary as per the Object. Toggle the options as per your business need.
Manage : Slack Alerts
Manage: Slack Alerts
  • Additionally, with Send to Slack: you can send any urgent/specific messages to any Slack Workspace/channel with any custom message. See below

Custom message: This opportunity is turning towards Closure. Make sure we focus and close it ASAP.

Send to Slack : From Salesforce opportunity record
Send to Slack: From Salesforce opportunity record
  • Instantly: the same message is posted on the Slack Channel 💖 Wow.
Instantly : the same message being posted in the Slack Channel
Instantly: the same message is posted on the Slack Channel
  • Posting Messages from Slack to Salesforce: use Add to Salesforce
A Sample Message in Slack channel, ready to Send to Salesforce
A Sample Message in Slack channel, ready to Add to Salesforce
  • Select the Slack Message > 3 dots > More actions and > Click Add to Salesforce 🌩️
  • Search and Select your required Salesforce record, in our case the newly created opportunity: “Oppty: Salesforce — Slack Awesomeness”, and then click Add
Add to Salesforce feature in Slack
Add to Salesforce feature in Slack
Confirmation on Slack : Message sent to Salesforce
Confirmation on Slack: Message sent to Salesforce
  • Now, head towards the Salesforce Opportunity record and make sure that message is visible in Salesforce as well:
Slack Message visible in Salesforce : under that opportunity record
Slack Message visible in Salesforce: under that opportunity record

Hint: In case Related Slack Messages component is not visible on Opportunity record page, make sure from the Edit Page > App builder, below component is added as required space in the page.

Slack Message Viewer : Component
Slack Message Viewer: Component

Congratulations, you have made it 💖

Salesforce and Slack are working perfectly together if you have reached the above stage.

There are endless possibilities with this Salesforce-Slack integration, search out and try for more and add to comments/ responses* sections for everyone’s help. Slack is made for collaboration, let’s collaborate here too if this post helped you learn something new.

* Type on the bubble icon to add your responses

References:

Developer details:

Please reach out to me for any suggestions or feedback. Would love to hear them❤

If you loved this post, please applaud me at the end of this post with a 👏

--

--

Sombir Sheoran

I'm a Certified Salesforce Consultant ☁️ who loves to write technical blogs, which help simplify Salesforce solutions. Follow to learn more ✨⚡