When Salesforce meets Slack - 2

When Salesforce meets Slack - 2

In my last blog, I explained about could be done using the drag and drop functionalities from the Slack Managed package.

Now, let's dig a little deeper and explore the configurable features that the Slack managed package has to offer.

Let's say you have a business use case where a team of Sales Rep collaborate on Slack. There's a process in place which marks the "Escalated" field on Case to true. As soon a case record would be marked escalated, the "Case" channel on Slack should be notified of that record. How would you achieve that? It's pretty simple.

1. Navigate to App Launcher > Slack Setup. Click on "Continue". Type in the Message Destination Name of your choice. In my case, I have named it "Cases" as I'm making one for Case. Select your workspace and then your channel. After you save it, copy the Message Destination ID as you'll be using it further. Capture.PNG

2. Now, create a new Process Builder as below: Capture.PNG

Define the criteria as required. In my case, I have applied a check for "Escalated" field. Capture1.PNG

Now, set the Immediate action with the action type as "Apex". Select the Apex class as "Slack: Post Message". This is one of the Apex classes that comes with the Slack Managed Package. Enter the respective values and hit Save and activate. Capture2.PNG

3. Now, anytime, a case is marked as escalated, all the users in the respective channel would get a notification as described below: Capture4.PNG

The similar implementation could be done through flows as well. I'll leave that for you to try. In my next blog, I'll explore the Apex side of customization using the APIs provided by Slack. That's gonna be a challenging one. But, let's see where that goes.

Did you find this blog useful? If yes, don't forget to share your feedback or questions!

Happy coding :)