Integrate Slack and Salesforce in 20 mins!

Why Integrate Slack and Salesforce ?

Did I hear you say – “Woah! This weekend chore is absolutely sorting my inbox”. Who would not love to have a zero inbox. You already have enough emails in your inbox to sort and what if it’s getting cluttered with all that email alerts and notifications from Salesforce too. At least I wouldn’t wish that to happen.

What if all these email alerts from Salesforce popped up as notifications in Slack thus reducing your inbox clutter? For example, assume you have a Big Deal Alert setup in Salesforce. Instead of sending the alert to your inbox, what if it came in as a Slack Notification.

In other words instant notifications that don’t need to stay in your inbox but need your attention.

How do we Integrate them both?

Back in May 2020, did you happen to see this – https://admin.salesforce.com/blog/2020/lowcodelove-watch-guide ?

It’s all about building apps on the Salesforce platform with little or no code. Embracing that very same idea, we need a solution where there is little to no Apex involved. A solution that is easily maintainable, scalable and future ready.

We’ve been doing API Integrations with Apex for a long time time. It’s high time to make a twist and see if we can do magic without writing a ton of code.

External Services – The Unsung Hero

If you are new and if you haven’t heard about it, I would recommend reading my previous introductory blogs – https://shrutisridharan.wordpress.com/tag/external-services/.

With External Service, you can now do API Integrations without writing a ton of Apex. Well as a matter of fact, no Apex at all! All you need is a Swagger Schema – a description of your API and then it’s all a matter of sparing a couple of clicks.

Why Use External Service?

My favourite – No Apex, No Unit Tests. Don’t tell me you love to write them 😉 External Services are invoked via Flows – the drag and drop builder that you are already familiar with.

You can set them up using the External Service Wizard (available ONLY in Lightning Experience) and use them swiftly. What is even more fascinating is that they are packagable and deployable too.

Slack + Salesforce

Let’s head to our use case with any further ado. Trust me it’s fairly straightforward.

We will have a button on the Opportunity which when clicked would send a notification to a Channel on Slack. And the ingredients would be –

  • Slack Workflow Builder
  • External Services
  • Flows

Setting ‘em up

Here is a brief video that shows how you can set this up –

Note: The GitHub link used in the video is available in the section below.

Great! I did it. What next?

Here are some of the useful resources that you can use to learn more about External Services –

  1. https://shrutisridharan.wordpress.com/tag/external-services/
  2. https://trailhead.salesforce.com/en/content/learn/modules/external-services
  3. https://github.com/shrutis22/slack-salesforce

Last but not the least, feel free to shoot me a message over Twitter or Email in case if you have any queries.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s