Salesforce + Slack = Awesomeness ❤️
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.
How it works in Layman’s terms ⚙️
Knowing your integration better
- Salesforce and Slack can be easily integrated with each other through the available Apps in Salesforce AppExchange, and Slack App Directory, respectively.
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?
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.
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
- 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
- Set up my alert for the required set of objects
- Go to the About tab to make all possible configurations your team needs with this app
- /salesforce command helps you to search anything within Slack from Salesforce
- 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 😮
- 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.
- And then click Get Started to authorize it. This is a one-time activity.
- Allow it to permit access to your trailhead playground. Once access is granted to the trailhead playground, you will 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.
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:
- We’ve our newly created custom alert ready:
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
- 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.
- Once your Slack workspace is ready with the required details, it should look something like this:
- 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.
- 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
- Click Sign in with Slack to open the popup and authenticate your Slack workspace which you just created in previous steps, Allow if needed.
- 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.
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.]
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
- Finally, Save and Activate the above process builder.
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
- 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 🚀
- 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.
- 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.
- 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.
- Instantly: the same message is posted on the Slack Channel 💖 Wow.
- Posting Messages from Slack to Salesforce: use 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
- Now, head towards the Salesforce Opportunity record and make sure that message is visible in Salesforce as well:
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.
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.
References:
Developer details:
- Twitter: @sombirsheoran
- LinkedIn : https://www.linkedin.com/in/sombirsheoran
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 👏