Launching ‘Salesforce Flow in Slack’#

Sombir Sheoran
7 min readAug 21, 2022

Learn how to use Flow in Slack to bring automation to any Slack conversation

Salesforce Flows in Slack

Pre-requisite

Since the feature mentioned in this post uses an existing Slack app setup, make sure your initial Salesforce and Slack Setup are ready and the Sales Cloud for Slack app is installed and configured in the Slack workspace.

🚩 Refer to the below articles for the same:

Business User case

Everyone Loves Salesforce Flow. What if they can be launched from Slack also? Yeah, You got it right! ✅ Salesforce provides the feasibility to use the Salesforce Screen Flows, to directly launch from the Slack app as well.

Let us consider a business scenario 💹:

Everytime business loses an Opportunity for a New Customer (in Salesforce, Stage = Closed Lost), they want to understand from the Sales team’s channel in Slack to gather feedback from the Customers to understand what was the reason they lost that opportunity. Questions come to mind, like?

  • Root Cause for Lost Opportunity, was the Product costly?
  • Was the Product of poor quality?
  • Would the customer ever want to purchase in the future? etc. etc.

Let’s go deeper. Whenever an Opportunity record in Salesforce of Type = New Customer and Opportunity Amount > 💰1 mn is changed to Stage = ‘Closed Lost’, we need to take the feedback from the Slack channel team members. Well, this can be achieved easily by Salesforce Flows for Slack.

🚩 As of Summer’22: Salesforce Screen Flows in Slack is still in Beta!

Preparing Salesforce Flow for Slack

Now that, we understand the business use case. Let us start building a Salesforce Screen flow, which will be gathering the customer feedback and would be launched from Slack.

  • From Salesforce > Setup > Flows > Click ‘New Flow’
  • Select Flow Type as Screen Flow and click Create
Creating a New Screen Flow
  • Add a New Screen component between the Start and End steps
Add a new screen component
  • Now, add some relevant Questionnaires to the flow using the Limited supported screen flow components for a Slack flow.

🚩 As of the Summer’22 release, only Picklist, Radio Button, and Display Text screen components are supported for a screen flow in Slack.

💡 Winter’23 onwards, many more screen components are being added to Slack flows. Give’em a try as they arrive in your org.

Adding the first Questionnaire in the flow of Type Picklist
  • Add another Questionnaire using the Radio Button screen component.
  • Also, at the bottom, add a Display Text component to add some text, and finally, click Done.
Add more Questionnaires in the flow of Type Radio Button and Display Text
  • Optionally, change the label of the Finish button to Submit Feedback
Change Finish button Label
  • The final version of the Flow should look as below (build the real flow as per your business need. This is just for the demo):
The final version of Salesforce ScreenFlow in Slack
  • Finally, Save the Screen Flow and select the Checkbox ‘Make available in Slack (Beta)’ to make it available as Slack Action in other Salesforce Flows. Any Salesforce screen flows with this Checkbox selected would be available as custom Slack Action(check the upcoming steps), which can be used in any Salesforce flow. Give it a meaningful name, say ‘Lost Opportunity Feedback Form — Slack Flow’, and Save it.
  • Once all is done, Activate the flow and make a quick run to see the user interface.
Make available in Slack (Beta)

👏 Claps for you. You’re now ready to use the flow.

Now, schedule your Slack flow to auto-run🏃

With Schedule-Trigger Flows in Salesforce

  • As already informed, the newly created Slack flow can be used as a ‘custom Slack action’ in any other Salesforce flow. Our Screen Flow was saved with API = ‘Lost_Opportunity_Feedback_Form_Slack_Flow
  • Let us create a new Schedule-Triggered Flow, (optionally) based on the Opportunity object and the entry criteria mentioned in the business use case.

🚩 A schedule-triggered flow starts at the specified time and frequency (Once, Daily, or Weekly).
You can’t launch a schedule-triggered flow by any other means. Alternatively, you can give the Entry criteria by selecting an Object and some initial conditions to the schedule-triggered flow.

  • From Salesforce > Setup > Flows > Click ‘New Flow’
  • Select Flow Type as Schedule-Trigger Flow and click Create
Create a new Schedule-Trigger Flow
  • Select the appropriate Once, Daily, or Weekly schedule time interval when you want to run this scheduled flow. For now, let’s select Once.
Setting new Scheduled flow inputs
  • (Optionally) We Select the Salesforce Object (Opportunity) and its entry criteria as mentioned in the business requirement below: Click Done.
Entry Criteria
  • Next, Between the Start and End steps of the flow, click + to Add an element and select the ‘Action’ interactional element.
+ Add a new Action element
  • Select the Screen flow in Slack (available as the custom Slack action) as below

💡 Hint: From the Left side, Select Category = Slack, type Lost <whatever was name of your Slack flow> for the Action box and it would give auto suggestions. Select your Slack flow created in earlier steps here.

Selecting Slack flow as Slack actions
  • Now, enter your required Slack action connection values and inputs parameters

Slack App = Sales or Service Cloud app configured in Slack

Slack workspace = Name of the Slack workspace configured

Execute action as = Slack App

Slack Connection ID = ID** of the channel or the group in your slack workspace, differs for every channel.

Slack Message = the message you want to see on Slack with this flow launch, enter TESTING SALESFORCE FLOW IN SLACK for now

Button Label = the label of the button which would be visible in the slack channel to launch our Slack flow. Enter Launch Feedback for now.

💡 ** Open any Slack channel in the browser and note down the URL, it would in the format: https://app.slack.com/client/<Workspace-Id>/<Channel-Id>. You can use this as the channel Id input in above step.

  • Click Done when all the details are entered.
Custom Slack action: Slack flow
  • Finally, Save the flow with some meaningful name and Activate.
  • Make sure to select a nearby Schedule time to run this schedule triggered.

Finally, Testing the Salesforce flow in Slack 🧪

  • Go to Salesforce > Sales Cloud > Select an Opportunity of Type = New Customer, Amount > $1mn and Change the Stage to Closed Lost, and Save it.
Update an Opportunity record in Salesforce
  • Since the entry criteria are set, all such relavant opportunities records which would satisfy these criteria would run as a batch job from the schedule triggered flow as per the scheduled time.
  • As the scheduled time arrives, voila! 🎉🥳🎊 A new message is auto-triggered to the Slack channel (the same channel on which you passed the Channel Id in Salesforce flow).
  • Note that the same Test Message and Button Label are shown(both fully customizable from the Salesforce flow).
Schedule trigger Flow in Salesforce — pushed a message notification

Now the real fun starts within Slack # 🤩

  • Click the ‘Launch Feedback’ button from the above Slack channel message.
  • What you’re seeing here is the Salesforce flow, running directly in Slack 🤟 More power to you now in Slack.
  • Slack channel users can select the appropriate answer to each question and finally Submit the feedback.
Submit feedback from the Slack

Congratulations, it confirms that “Launching Salesforce Flow in Slack#️” is working perfectly.❤️

💁‍♂️Tip to try yourself: Create a new custom field(s) on the Opportunity object to track these feedback responses and update that field value with these responses to track real-time feedback. May use the Assignment and Update record operations as needed.

Related Articles from the same developer:

Developer details:

Please reach out to me for any suggestions or feedback. Would love to hear them❤ If you loved this post, please applaud 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 ✨⚡