[00:00:00] Speaker 1: Wouldn't it be cool if, when a record in Salesforce changed, you could have a workflow in Slack start? We can do that. Watch this. Hello and welcome back to Slack School. My name is Mike Reynolds. I'm going to be your host. I'm part of the Slack team here at Salesforce. I'm excited today to talk to you about running a workflow in Slack just because a record in Salesforce changes. There are a few things that you need to make sure you've got set up before you dive into this episode. The first thing you need is a connected Slack and Salesforce environment. If you don't have one of those, you can go to the URL sfdc.co forward slash getconnected. This will take you to a Trailhead project that will step you through the whole thing, or you can watch my episode with Jennifer Lee. She and I step through the whole thing. It's good fun. The other thing you'll want to do is install the Slack platform connector. You can get that at sfdc.co forward slash Slack connector. Once you have that installed, you'll be able to complete all of the activities that I'm going to run through today. There are a lot of reasons why you might want to create some automation in Slack based on record change events in Salesforce. A couple of simple examples might be we're about to breach a milestone. This customer service needs to be provided, and so we've got to send some messages to people to get them moving to make sure that we don't violate that SLA. Another example is I might have an opportunity that's been created that is really big, and I want to tell people about it and maybe take some actions. That one's a bit easier for us to demo because we don't have to set up milestones and entitlements first. So we're going to use that example. If you stop moving in front of the computer, paste on that side of the computer. No one needs to see my stickers. So let's dive in. Using this big deal alert idea, I've created a channel called Alert Big Deal Alerts. What I'll do is I'll go to More, and then inside my tools, I have workflows. So I can click on New, Build Workflow. Now, we need to choose how to start this workflow. Last time, we started the workflow from a link in Slack, which is really handy, but we don't want to do that. We want to rely on our Salesforce connection. So I'm going to choose Salesforce from my left-hand menu, and the option that I have here is when a record changes. So I'll select that. We need to choose which Salesforce organization. I'm only connected to one. That makes it simple. And then we need to set the object. Now, we know we're going to use the opportunity here. This part of the flow should make a lot of sense to us. Now, we can conditionalize this, which it's great to conditionalize our automation. I don't want things to always happen. So how about when the amount is greater than... Let's make it $100,000. So when the amount is greater than $100,000, I could further refine this, but for this example, it should be okay. I'll click Continue, and then we can carry on. So what do we want to do? What do we want this business process to look like? Well, I've got a channel where I'm going to notify about these big alerts, something that I'd seen work really well when the point of the channel is to make announcements, is to have kind of like a headline, and then in the thread, more of the details. And so we're going to replicate that here. Here's how. We'll start by clicking Add Steps, and then send a message to a channel. We want to specify our alert, Big Deal Alerts channel, and then we want to type a message. How about, there's a new deal for account. And then we'll insert a variable. This is one of the great things about doing these Salesforce record-triggered automations, is we have the data. So when I click over here, I'll do that one more time, on this Insert a Variable, when I click on that, I get everything that relates, and it doesn't matter where I go, I have all of the related data. Here, I want that account name. So I'm going to choose Account Name, and so now the message will read, there's a new deal for account, and then whatever the account name is, which is perfect. We'll put a little exclaim on there, because we're excited about it, and then Save. So again, that's going to be our main message. We now want to add some more details in the thread below. So we can choose Add Step, and in the search here, I'll look for Thread, and we'll select the message that was sent. Now here, we can do a little bit of a trick. I could go back over here to Insert a Variable, and choose my opportunity, and then I could find lots of different facts, and I could bring those facts over, but that seems like a lot of work, and I'm kind of lazy, so I'm going to take a shortcut. What I'm going to do, is I'm going to say, just Opportunity Details, and I'm going to highlight all of that, and I'm going to make it a link. Now, what I can do, is here, I've jumped over to Salesforce, and I've got this test opportunity. I'm just going to copy the URL, just the whole URL, and I'm going to come back over here, and I'm going to paste it in the link. This portion, if I double-click, it'll highlight the Salesforce Opportunity Record ID. I'm going to take that out, and then I'm going to click on these brackets over here, and here, I'm going to insert the opportunity ID. Now, the reason why I'm doing this, is it will rebuild the link that goes directly to the opportunity, and that's going to let some Slack magic happen. We'll see that in just a moment. I'll save that, and then I can honestly, I can just leave this just like it is, but we might want to have some extra things happen. I'm going to add an interactive button, except I'm going to call this Create Channel, and we'll have this beat continue, and then here, I'm actually going to set this to single-click. I only need to create a record channel one time. I'll hit Done, and then Save. Now, let's think about what we have here. We've got your title, your banner message. Hey, we've got a new big deal, and then below that, I've got a link to the opportunity. Slack is going to do what's called an unfurl with that link, so it's going to display kind of like a card. You'll see that in just a moment, and then I've got a button to create a channel, so we need to go ahead and create that channel if they click, so we'll do an Add Step, and then here, I'm going to go to Salesforce, then Find or Create a Salesforce Channel. Now, it wants to know what's the record ID. Well, we already know we can get the record ID. If I click down here, it's going to give me a lot of options. I want to start with this opportunity ID, so we'll put that here, and then if no Salesforce channel is found, go ahead and create one. Perfect. We'll click Save, and so now, it's created that channel, or it will create the channel if it doesn't already exist. So, I want to tell people about that, so let's add a step, and we'll go and do another threaded message. We'll choose the message that was sent, and then here, I want to put a link to that channel that I created, so let's put a little bit of a message here. Here's the new Salesforce channel, and then we'll insert a variable, and we're used to seeing this now. I've got all these great details, but I want that channel link. If I scroll past this Salesforce data, down here to step three of my automation, I've got the channel, and I could just leave it as it is. I do have some options on how I want to display this, but we'll leave it with the channel name. That'll be perfect, and we'll hit Save. Let's go ahead and click Finish Up. We'll give this a name. We'll call it Big Deal Alert. I love a good description always, and we'll click Publish. We don't actually need to add it to the channel, so I'll just close this for now. Now we need to test it. I could jump into Salesforce and go create an opportunity, or I could just look at this account's record channel, and then click New Opportunity. If you're seeing this account details, if you're seeing this thinking, oh my gosh, how did he get that Salesforce account into Slack, go check out the episode about Salesforce channels. I can click New Opportunity here. We'll call this Big Deal Test, and we'll give this an amount, and we've got to have a big amount here, so I'm going to say that much, whatever that is. Qualifications date's good. Opportunities, love a close date. We'll give it a close date near the end of the month, and click Save. Now, this is a good time to take a moment to talk about synchronous automation and asynchronous automation. When it's asynchronous, we essentially allow all of your synchronous stuff to happen. We finish that up, and then when system resources are available, we then get around to it. In the amount of time it took me to do that, this happened. So here's my thing, my message posted by the workflow. Here's a new deal for account Salesforce emerged in that name, which is great, and then when I view the thread, you'll notice I actually get my opportunity record right here, and when I click on it, I can view this opportunity in the same way that I would anything else. It's editable. There's a description. I can save that change, have everything come in. It'll be very easy, simple to do. I can also click this button to create a channel. So when I click that button, you'll notice the button goes away because we said it can only be clicked once, and then I've got a new message that was posted in the thread. The big deal test one now exists. I can click this and open up my new channel, which was created by my workflow, and again, I can see the opportunity information right here. Automating your business processes using Slack workflow has never been easier. So what are you going to build? Jump into the Slack community and let me know. If you've got an idea for an episode or any feedback, you can get into the Slack School channel and use the workflow that we built, and you can test it out. Let me know what you think we should do next. Don't forget to like and subscribe, and we'll see you next time. Oh, hey. You did a great job today. I can't wait for Salesforce workflow to go live on a farm with S controls so that I can stop saying Slack workflow and not Salesforce workflow. I want that.
We’re Ready to Help
Call or Book a Meeting Now