top of page
Writer's pictureOded Harniv

All This Flow - Part II: Automating Slack Message Destination with Flow

Updated: Dec 5, 2020

If you're using Slack for Salesforce you know that in order to post from Salesforce to Slack, you need a Message Destination. A Message Destination represents a conversation in Slack where Salesforce data is shared and consists of a specified Slack Workspace and Slack Channel. The destination information is passed into the Send to Slack invocable method, which then sends Salesforce data to the specified conversation in Slack.


The Need

Posting a Direct Message (a message directed to a specific User) to a Salesforce User’s Slack Channel in specific scenarios, such as a reminder when a due task was not completed.


The Problem

Message Destination needs to be manually created for each user. Additionally, some users of an organization might already be using Slack for Salesforce.


The Solution

When the challenge of generating Message Destination for numerous users was presented to us by a customer, we decided to build a flow automating the Message Destination creation.


Automating Message Destination Creation

To connect a Salesforce user to organization Slack, the user needs to authenticate its Salesforce environment with Slack. We have created a flow that is triggered after the Slack Auth record is created, that automatically creates a Message Destination record for this User.

Theoretically, we could’ve added Slack Workspace to the destination, but in our case this wasn’t required. We used a version of this flow and ran it on existing Users.


The Result

This flow enabled a swift, automated generation of Message Destination for hundreds of our customer’s users. Newly added users are now automatically assigned a Slack Message Destination and able to receive relevant Salesforce data via direct messages.


Walkthrough

The screenshot below illustrates the flow we’ve created for this Slack automation. With the authentication, the record is created from the Slack Auth Object and creates Message Destination.

 Flow Builder  - After Create Slack Auth - Triggered Flow
Slack Auth After Create Triggered Flow





















Get Record -Flow Builder for Slack and Salesforce integration
Get the User Record


Create the Message Destination


Using it - Automation of Messaging

With the streamlined Message Destination creation, we can now deliver needed Salesforce data to its users via direct Slack messages, a process that is defined and automated per their organizational needs.


Using Get Message Destination for a Specific User


























Get Message Destination for Specific User

154 views0 comments

Comentários


bottom of page