In this 30-minute presentation, the CTO of Provar Testing, Richard Clark, discusses the many benefits of integrating Slack with Salesforce and explains how to properly do so. With a step-by-step demo, he provides straightforward and visual guidance for sending Slack messages through Salesforce. The talk is heavily developer-focused, but it’s presented in a manner that allows for simple understanding. 

This tutorial delves into many common situations where Slack could improve productivity and communication. Each step builds upon the previous information, and by the end of the discussion, viewers will see the final product created through the process. This allows anyone who wants to integrate these two tools to have their first executable code within half an hour. 

The discussion finishes with a Q&A that focuses on additional features, common issues, and security concerns. Any Salesforce user hoping to take communication to the next level in their organization will find this discussion invaluable. 

What You Will Learn

  • Possible use cases [00:00:31]
  • Case swarming [00:02:15]
  • Configuring a Slack Webhook in Slack [00:04:15]
  • Mapping channels [00:06:44]
  • Creating new DX project [00:07:37]
  • Create Apex classes [00:09:29]
  • Using Queueable Interface [00:11:03]
  • Adding Salesforce flow or Process Builder [00:21:04]
  • Add logic to send message in Slack [00:23:51]
  • Adding a remote site setting [00:27:12]

Integrate Your Data Today!

Try Xplenty free for 7 days. No credit card required.

Full Transcription

Richard

[00:00:00] Hi everyone. Welcome to X-Force. My name's Richard Clark. I work for a company called Provar Testing. We're the number one test automation software for Salesforce. And today I want to talk to you about integrating Slack with your Salesforce, something that we've done for our own company at Provar.

[00:00:31] So, some of the possible use cases - you might want to do this - I'm going to talk about first. We're then going to look at the solution overview. I mainly spend the time doing a one-take walk-through on live coding, the clarity of a configuration, and then hopefully testing. And we should see everything working before the end of the talk. All the code examples, the process builder, everything I use is available at the end of the talk.

[00:00:56] I've got to get her project and I've got a Salesforce DX unlocked package, which you can install if you wanna use the examples I showed today, or please write your own. So some of the use cases you might want to consider is, at Provar when we have a deal, when we have a new customer signed up or a renewal, we like to notify the whole company.

[00:01:16] Now, the reason we do that is, the reality is we don't have all our staff on Salesforce. I know that's shocking, isn't it? But our developers, most of our QA team, most of our admin team are not on Salesforce. So what we want to do is make sure that you can share in the success because everyone contributes towards the success of our business.

[00:01:35] So we like to make sure everyone gets an announcement when we sign a new customer and know how big it is. We also get benefits from that because our onboarding team know that something's coming in the order pipeline, and our customer success team know there's another customer coming on board. And they recognize the name, the industry, and know how valuable that customer’s worth to us.

[00:01:53] Another area I'm introducing Slack integration itself at Provar is around our service cloud as well. So not just sales cloud. And today the solution I present could be used for any of these use cases. The code I use can be used for any of these, so I want to make sure that when we have a case if we're not responding within the SLA for that customer, I want to make sure that we can swarm on that case.

[00:02:15] It's a common term, “case swarming.” What that means is I want to direct the attention of all our experts in the company so that other people can jump in, get involved, and help resolve the issue for the customer before we breach an SLA. Another area that I want to use this - and not using it yet - is around approval requests.

[00:02:32] With the demo I'll show you today, I'm going to do some very simple messages so it's not too complex to follow. But we can do quite rich things with Slack. We can put buttons in, we can put in image links, we can put in lists. We can put in applications that interact with the user. And one of the things that's very commonly templated is approval requests.

[00:02:49] So I don't know about you, but I still get people sending me emails for approving holiday requests because we don't have our HRMS system at the moment. That really annoys me. I'd much rather they sent me a Slack message.

[00:03:00] So from Salesforce, we can have some of those approvals - whether they are holiday requests or whether it's people wanting approval on a discount for a deal - we can actually feed those all through Slack so I can interact there. Or I can click a link to go back into Salesforce if I want to approve it in Salesforce.

[00:03:14] Another area is - as I mentioned, not all our staff are on Salesforce - so when we have a Chatter post, it’s quite interesting. I want to share that to non-Salesforce users as well. So again, I can take that feed post or that feed comments, and I can push that onto a Slack channel. In a similar vein, we have a number of partners, both technical partners and customers who participate in our customer advisory board, and I want to sometimes send information out to them.

[00:03:36] Maybe it's details of a new release notes, a new download or product feature, or just the general discussion. And again, we share Slack channels with them. Our Slacks are integrated so I can do that using this solution today as well. And then finally, there is a free Slack AppExchange app. If you're not a developer - the talk is very developer-focused today.

[00:03:57] If you're not a developer and you want a declarative only solution, then feel free to install the Slack AppExchange app. It does have a couple of limitations. You are limited on the configuration and the messages it posts, and it only works on standard objects. So if you want to use this sort of custom object, you'll need to use the solution presented today.

[00:04:15] So let's look at the solution we're going to see. So the first thing I'm going to do is I'm going to show you how to configure a Slack Webhook in Slack. I just want to stress that when you are following along with this - hopefully, you follow along with it - that you don't try and do this in your production company Slack.

[00:04:32] All right? You do not want to be sending hundreds of messages to all your staff, even at a private channel. Do not do this on your company Slack. So, configure a new Slack workspace. They're free, and the free version works completely with the weapons. Get it working there first before you start hooking it up to your company Slack.

[00:04:52] The next thing we're going to do is to write some Apex code. You’re not going to see my fingers and thumbs typing away desperately, so I'm going to copy and paste some examples I’ve already set up. As I said, the examples will be available at the end - including unit tests.

[00:05:08] Once we've got our Apex code, the Apex code is how to post a Slack message. It doesn't have any business logic here about when to post those Slack messages. And what I like to do is using invocable Apex to expose that so our admins can choose and reuse that solution. So admins can choose whether to post a message on a case form, or an opportunity big deal alert, or any place where they feel there's some value.

[00:05:29] They can have the power to do that. So we're gonna use invocable Apex parts today as well. And so, Process Builder will be our business logic front-end. I could equally have used flow, but Process Builder is probably a bit easier to follow along with. So, first step is create that new Slack workspace I just talked about.

[00:05:46] I've already done that. I'm going to create a new Slack app, so I'm just going to click that. I'm in my Slack, hopefully, I’m in my development Slack - my demo one. Let's have a look. Yep. Provar demo, and I give this app a name. Guess what? I'm going to call it X-Force. I'm going to create the app.

[00:06:05] It doesn't take long. Now I can add some features to that. Now this is the same way you build any app on Slack. I could do lots of things in here. I could build a bike and I could have their slash commands to query. I just want something very, very simple. I just want an app that's going to listen to requests coming in externally.

[00:06:22] So I need to configure a Webhook. Now I need to activate that. Now I've activated it, and it's expanded below. First thing we have to do is add an endpoint to listen to him - decide what channel we want to post to. So if I'm having different Webhooks going to different channels, I'll have multiple Webhooks in here - one for each channel and map too.

[00:06:44] So let's map our first channel. So my channel was already created. I could go back and create it now, but I’ve created one, X-Force, which we're going to use. So now that it’s got access, it's going to have binding between that. The other thing that's generated is its generated a goo ID for that webhook URL.

[00:07:03] Before I continue, I want to make sure that that is going to work. I don't want to go through all the process of writing code only to find out I haven't configured Slack properly. So I'm going to copy this code command, which is nicely formatted for me, and I think I’m gonna switch over to visual studio to my terminal.

[00:07:20] Let's just expand that. Just going to paste that in. So what we should see - this also helps me check if my Slack popup window is gonna appear on the right screen or not - we should see that pop. Okay, I heard it go “click, click,” but you haven't seen it on the screen. So let me just open up my Slack. Here we go.

[00:07:37] X-Force, “Hello world.” So we know that's working. That's good. The next thing I want to do is to create a new DX project. So we're gonna have a brand new scratch org. We're gonna have a brand new DX project, so you're gonna see this all happening live, and I'm going to write some Apex classes. So going back to my visual studio... just let me move some of these windows out of the way...

[00:08:02] There we go. And I'm going to do Control-Shift P and I'm going to create a new project with Manifests. Just use the standard projects and give it a name, “X-Force”. Take the default location, my Slack CAC. Let that run. So now we've got a brand new Visual Studio code project and it's got my “forceignore,” it's got my “sfdx-project.json,” and the other thing it’s got is config file so that I can spin up as a new default org. Let's do that, Control-Shift-P.

[00:08:43] Create a Default Scratch Org. Hopefully I've got the right Dev Hub connected. I'll use the same name, “X-Force.” How long to live? I only need it for a day - cause we won't need it after this session. All my codes can be backed up of course. Okay, that has failed. Let me just check why. Okay, that is the wrong Dev Hub.

[00:09:04] Let me just change Dev Hub.

[00:09:14] So I'm just gonna use our company one instead of a Trailhead one. Okay, and I'll try that command again. Let’s create a “Default Scratch Org.”

[00:09:29] Same details: “One day.” Okay, so that's running. The next thing we're going to do when that finishes is we're going to create some Apex classes. Those Apex classes - I'm going to use, evacuated pecsand I'm going to use a Cuba interface. There we are, that org created now. So let's go and create our first Apex class, and I'm going to call this one Slack Publisher.

[00:09:57] And the right default directory, it’s created with a default constructor. I don't really need any of that. I'm going to replace this with some code I prepared earlier. The first thing I'm going to do is add the Webhook that we just saw in Slack. I don't need this constructor, so I'll get rid of that.

[00:10:17] So I need to put in my Webhook. You'll see this in the get hub project. It says “your Webhook here.” If you get a hold of a version that has an old Webhook here, it's not going to work. It's stale. That channel is dead. That Webhook is dead. Where do I get that Slack URL from? Well, I'll go back to my Slack API.

[00:10:34]It's worth remembering and saving this, but obviously once I've taken a copy and put it in my code, it'd be in my repository. So I'm going to copy that and just replace it here. Pretty easy so far. Okay. And next, I want to create an inner class. So, the inspiration for this talk came from an article by Christophe Coenraets back in about 2016. He did exactly this. He integrated Slack with Salesforce.

[00:11:03] And through that I actually learned about the Queueable Interface. So what we've got here is an inner class with some methods. Don't be too scared. That implements two interfaces: it allows call-outs, which I need, and it's queueable. So you may be more familiar with requests using future methods.

[00:11:23]We're still gonna send a callout, but by doing it, using queueable, what we are doing is we can send things asynchronously and we're able to chain requests together if we want to. We've got greater limits of what we can do. And actually the other thing we can do with the queueable interface that you can't do with future method is you can actually use an S-object or complex construction of a payload instead of using simple objects such as string, integer, et cetera.

[00:11:47] So within this queueable , Slack-called class independent interfaces, I’ve got three parameters. Variables URL, method, and body. I've got my construct to where they're set, all fairly basic there. And because I'm using the Queueable interface, I'm implementing the execute interface so that when this job is scheduled, it will be picked up by the Apex, a task runner, and it will execute the execute method with that context.

[00:12:14] And here is where the magic's happening. We're basically setting the endpoint to the URL that was parceled - the constructor - set in the method I get posts, et cetera, and the payload, the body, which is basically an adjacent object. And at the end we'll see how you can get to different examples and templates with those adjacent objects.

[00:12:29] I haven't put any air handling in here, it is very basic. I do apologize, but hopefully, it allows you to see the code a bit clearer. So that's all I need to do to actually send the message, and I could use this already from say an Apex trigger if I wanted to. That would be far too easy. So let's make things more complex.

[00:12:48] What I'm now going to do is I'm going to add another inner class. Now, the reason I'm doing that is I have some content I want to send from a declarative, from Process Builder and flow using the invocable Apex, and it'll do that. What they want to do is send that as a message post, so I've just got a simple class here, and in that message post, I've encapsulated an attribute called post text - because what we're going to send today is a very simple message.

[00:13:16] But if I wanted to send buttons and images, attachments, and other things, I'd want to pass more information than just a single string. So I can encapsulate that still in my message posts. You'll see here, the invocable variable - it’s got a label of Slack message - so that when I'm in Process Builder, we'll see when they're trying to match what we're mapping, it'll say Slack message.

[00:13:35] That's that label that comes from there. And then the last part of this class is to add my invocable Apex class. So I'm just going to grab that example, and here we go. So I like invocable APEX because if I get something working in code with limited unit tests, I can then hand it over to my admins and they could be responsible when it fails in production.

[00:13:58]Obviously I'm only joking. Of course, I'd help them. So this invocable method, remember, you can only have one invocable method per Apex class - at the moment at least. So if you have different methods you want to send - maybe a simple message, maybe you also want to have something that's going to post as the approval buttons - or you want to send an image or a list or search results - all those things are possible.

[00:14:18] You're going to need to do those in separate classes, so think about that in your design. Again, I'm giving it a label. So when we look for this method, I can see what the name is. So I understand it’s the simple message to Slack rather than a complex message to Slack. 

[00:14:32] And for simplicity, while with invocable Apex you typically pass a collection - and in this case, I'm passing a list of message posts i.e. that inner class up here containing the post text - I'm only in this example today handling the first one. Now it'd be very easy to put a loop around this and send multiple and queue multiple jobs, and that's why I've used the queue.

[00:14:53] What you have to think about is the user experience. If I deliver something whereby I'm sending 10-20 messages per hour or minute into a Slack channel, your users are A) going to complain, B) they're going to mute that channel or three, they're going to leave the channel completely. So you're defeating the whole point of communicating to them in the first place.

[00:15:15] So do think and use the Slack posts responsibly. I personally have a whole backlog of emails I never read because I get so many, but Slack I keep up to date with. I keep up to date with it on my phone. I keep up to date with it on my desktop. So it's a valuable resource. Do not abuse it.

[00:15:30] So I'm going to take that message or post, and I'm going to create a map of strings and objects. The reason I'm doing that is because this is my JSON payload, so I've got the label and the JSON. In this case, the first one's text, and I've got the content - the post text. If you have other JSON templates you're going to use, then you'll have more attributes you put into this map.

[00:15:52] The other strange one I've got on this map is markdowns, and markdowns are very useful. By setting markdown to true, I can actually do some formatting on that text. So rather than just send completely plain text, I can add some styling. I can add some new line characters. I can add bold, I can add underscores.

[00:16:08] I can add italics. There's lots of things you can do and it's all documented on the Slack API website link at the end. Now I've got my map, I've got my content, my payload. What I want to do is basically I use JSON.serialize so I don't have to play with string manipulation, and no curly braces in trying to map it together here.

[00:16:26] JSON.serialize is your friend. And now that I've got that, alI I do is queue the job. So if I queue that job, it will fire asynchronously. And passing it that URL at the top - my Webhook I've just created - and passing it a post, not a get method, of course, and I'm giving it that body, given that payload which I wanted to process, I'm going to save that. Now in theory, that's all I need. And I can push that into my org, and I'm going to do that just to make sure I've not made any typing mistakes at the moment. So I'm just going to push that into my default scratch org I just created.

[00:16:58] And then I would just want to quickly talk about the unit test side of this because that's great - it’s working in my dev hub - so it's working in my scratch org - but it's no good if I can't deploy it into production. So I'm going to create two more Apex classes. The first one I need to create is an HDP mock concrete class.

[00:17:15] So I'm going to call that Slack publisher mock.

[00:17:22] Again, Default Directory, let that open up. Again it has default constructor. This time I'm just going to overwrite the whole class with my test class. So the reason we need this is, in a unit test you can't make HDP callouts. So if I just write a normal unit test, it's going to fail. This implementation of HDP callout lets me mock that up so my unit tests will pass.

[00:17:48] It gives me code coverage, but it's not giving me real end to end testing cause we cannot do that unit tests. I can't stress that enough. Unit testing is not testing - not completely. And the other class I want is my test class. So again, I'm gonna create a new Apex class and I'm going to go SlackPublisherTest.

[00:18:10] And take the defaults. And just going to overwrite that one as well. So again, I'm not using any data in New York. I'm using test setup to create the data I want: an account, a contact, and an opportunity with default amount for 100 pounds or dollars. Stage name: prospecting. So the basics I need, and I've got one test method, which is selecting that opportunity for my test data.

[00:18:35] I'm using test.setMock to use that mock class. So the HDP called outs will basically get swallowed, but it allows me to actually run unit tests. And then what I'm doing is updating my opportunity to $1 million and updating the Stage Name to ‘Closed Won.’ So those are two of my use cases that I haven't implemented yet.

[00:18:54] Now, what I've got here is I've got unit test code that's covering Process Builder, and if you want to deploy Process Builder as active tray org, then you need to have coverage for them. In this case, I don't just want to rely on Process Builder being present for my unit test to pass. If an admin deletes that process, I suddenly don't have my unit test coverage. So I'm also going to call that a method directly.

[00:19:17] I'm going to call my message posts, my posts to Slack directly in my unit test as well, just to make sure I've got full coverage. And the next thing I'm going to do is - we have that queueable execution - if you recall over here. So the post is Slack. So again, I'm just making sure I've got coverage on the in-queue job.

[00:19:34] So this is making sure that the queue and mechanism is working as well. So I just want to make sure everything is working. Hopefully I've saved all of those. Just check that. And the next step is for me to push that to the org - those extra test classes.

[00:19:51] So fingers crossed on this one. Okay. I've got a failure in that. Let's have a quick look and see if we can solve that. If not, it's not a problem. Okay, I just made a bit of a typo in my copy and paste. Let me just fix that. Extra ‘L’ in there. Just make sure there's no others. Okay. And let's just deploy that again. Successful, great!

[00:20:22] Now, if I want to, I'm going to run my tests. Let's refresh this, and run those tests. And while they are running - just in the interest of time - I'm going to flip back to the slides. I'm going to flip back to Salesforce. So let's just check that. So just to recap, we created a new DX project and we created a scratch org, so it was brand new.

[00:20:45] In that scratch org we created some Apex classes. You need one, but the three classes are there just to make sure we've got a unit test there as well. I've just been deploying them to the scratch org. If you don't want to write the code in the examples at the end, you can install the demo package or clone to get our project and can you get all the content or the classes that I've just shown you.

[00:21:04] The next step I need to do is adding a Salesforce flow or Process Builder to invoke that Apex, and this is the same where I hook up that business logic side of things. So let's just flip back, see how we did. Our unit tests all passed. That's brilliant. That's good news. We can continue with the next step.

[00:21:20] What I'm going to do is open that default org I've just created. So hopefully this isn't going to zoom into a giant picture of me - which it did when I purchased it earlier. So brand new scratch org spinning up. Hopefully. There we go. And the first thing I'd do is just make sure that my changes are there because I do like to make sure things are deployed first.

[00:21:43] If I haven't got my changes in this org, then I won't be able to find them in my Process Builder.

[00:21:50] So we should see three classes. There we go. All deployed, and let's go to Process Builder.

[00:22:05] Okay. I don’t have any processes at the moment, so let's create a new one. So I've got to call this Opportunity Management because obviously I want my processes to be across more than just one functional piece. Remember, the limits on workflows applies to processes equally - or my opportunity management and this automation. And I'm going to do it when the record changes.

[00:22:32] And say it's about opportunity. So I add that as the object. Nothing groundbreaking here that you haven't seen before. I'm going to make sure it's when it's created or edited. Obviously the editors I really want don't need to make it recursive. Not yet at least. And I'm gonna add my criteria. So these are my business rules.

[00:22:51] My first business rule is my big deal alert, and we're going to do that when the amount [00:23:00] is greater than 1 million - or greater or equal to. 

[00:23:08] And all the conditions are met, and I only want to do this when there are changes made. I don't want to keep sending that message every time someone edits that opportunity. So I want to make sure that's set. I'm gonna add a second action here, just so you can reuse it, and that action is going to be an opportunity to close one.

[00:23:29] So again, I might have some consistent processing, so I'm going to take my stage name equals close one. And again, I only want to do it when it becomes close one, not every edit after that point. Just really important here, make sure your processes evaluate the next criteria, or you'll find only the first one is firing.

[00:23:51] So I've got my actions, but I haven't actually hooked up any logic. The good news is the logic is the same. I add my action - it’s Apex - seems odd in Process Builder. And I’m going to say Send to Slack. My Apex class should be found for me and it should show the method that we created, “post simple message to Slack.” There we go.

[00:24:11] And what I now need to do is just say, what is the message I want to send? Slack message, that variable within the invocable Apex. And I'm going to use a simple formula field here. So the formula I build is going to be basically an opportunity and include the opportunity name. Put some spaces in.

[00:24:34] Type name properly. Big Deal. I'm going to put Big Deal in bold by using the asterisks. So this was that formatting I was talking about. 

[00:24:47] And I'm going to also include the amount field. Obviously you're free to put whatever you want into these messages. This is just my example.

[00:24:58]Amount field is a numerical currency field. So, do you want to wrap that in text, otherwise, my formula won’t validate. Okay. That's easy. And then on Ops Closed Won, you do basically exactly the same thing. Every time I want to use this invocable Apex, I just do the same thing. And I don't have to change the Action Name.

[00:25:17] Action Names did not need to be unique. Post message to Slack. Add a row. Slack message. Formula. This time I’m gonna say, opportunity for the account name - if there is one,

[00:25:46] And I'm going to congratulate the salesperson.

[00:25:51] One word of warning. When I did this approach, I got a lot of feedback that everyone else that helped the salesperson felt like they didn't get enough credit. So I did have to adjust the message. I did have to do something more complex than the answer. Do be aware of that one. And I’m just gonna get their first name.

[00:26:10] Okay, so I've got a simple form to fill there. Save that. Remember to activate my process or we're not going to see any results. Now, I guess you guys want to see this working, do you? This is the nervous bit, so no guarantees I haven't made any errors here. Let’s go to Sales Cloud and let's see.

[00:26:38]So I'm going to create an account.

[00:26:42] Let’s call it X-Force.

[00:26:47] Probably as much data as most people put in their accounts when there’s mandatory fields, and let's create a new opportunity as well. Let’s just create it for a hundred dollars to start with. Today's close date. X-Force Demo Live and on the X-Force account. Stage Prospecting. So I'm doing this initially to make sure my triggers don't fire - to make sure my process doesn't fire.

[00:27:12] I'm desperately scratching my head to think if I've forgotten anything, and I just now remembered what I've forgotten. The other thing I need to do to send that Slack message is I need to add a remote site setting. If I don't do that, Salesforce is going to block the request. So remote site settings, there'll be one in there by default, but let's add one to Slack.

[00:27:35] Let’s call it Slack and the URL I need, it's basically the same one, but just the first part. The hooks.slack.com

[00:27:47] Okay. I'm glad I remembered that. Back to our X-Force demo. And so what I'm going to do is I'm going to edit this opportunity, and I'm going to change the amount to 1 million. Actually, I might make it 2 million because I'm not sure if I put greater than or equals or greater than. So we'll find out. And if all goes well, we'll see a message pop up.

[00:28:09] Well, I heard the click, but some reason I'm not getting my little notifications in the corner. There we go. Big deal alert for 2 million Hooray to me. Let's see if we get the same thing on the close case. So hit close. Close one. Save that. Again, I got the clicks. I don't know if you can hear those, but I'm looking at my notifications.

[00:28:33] Opportunities for X-Force Closed Won. Well done user. User being the name of the default user in any scratch org, unfortunately. Okay. That is the end of the demo. So we added that Salesforce flow. Beg your pardon, just let me just present that. We added Slack as a remote site at the last minute. I remembered to do it.

[00:28:52]Don't forget to test. Unit testing is insufficient to prove this is working. So your choices for integration testing are either manual testing like I just did, or end-to-end automation tools like Provar, which can hook in both to Salesforce and actually you can look at the Slack web app as well and check if the message arrived.

[00:29:08] So do consider automation tools please. If you'd like to know more about Provar’s Salesforce UI and API test automation capabilities, please visit our website. Otherwise, if you want to get hold of the project I've used today, please go on my personal GitHub profile, rclark-provar/slackhack, and you'll get all the examples from today and any other notes on up-to-date packages. The X packages on the packages.

[00:29:30] There is the official Slack app exchange app if you prefer not to do any code. I've put a Bitly link on the screen there if you want to take screenshots. It’s not bad to have a play with it. And then if you want to learn more, the original article by Christophe Coenraets is on the screen there. And we also have the Trailhead course on Slack development basics, which goes into a lot of good detail about the types of integration you can do with Slack and the different templates.

[00:29:56] And then finally, the Slack API guide is really, really useful. In the example today, I use this very simple message formatting. There’s something called the block kit builder. Don't be scared of it. It's just another form of JSON. And in that you can select different templates. The great thing about the block kit builder and the message formatter is as you make changes, they are reflected in real time. So you can see if your changes are working in real time, and you can set different templates to work from your approvals, your agenda builders, onboarding - whatever it is you want to do, you get all these different options. So it's a really, really useful, forum to find examples and to make changes.

[00:30:59] So I do recommend that. Last but not least. I'd like to thank you all for coming to the Xforce summit and thank the organizers for inviting me to talk. Thank you very much. 

Host

[00:31:08] Thank you, Richard. That was fascinating. I wanted to ask a couple of questions. The first one was in the example that you've posted on your site there, does that have the air handling in it?

Richard

[00:31:21] No, that's where the work comes in. It doesn't generally, it doesn't go wrong. It's going to fire away or it’s not going to fire. But yeah, we could have done stuff. What I have put in the unit test, the ability to mock up a failure response, and so you can actually test your error handling when you write it.

Host 

[00:31:13]I mean, we're talking about a nice to have, not a mission-critical integration, probably. Depends on the organism. 

Richard

People should write the code, but I'm not giving away a solution or responsible for the code when it's shared. This purely is a demonstration of what can be done.

Host

[00:31:29] Fair enough. Fair enough. Can this co-exist if you have the Slack app exchange app installed - I assume the answer is yes? 

Richard

Yeah, we actually use both. So we have that for some areas where the Slack app exchange app did exactly what you wanted. And what I've done on the custom solutions is the areas where it didn't deliver on things like our custom objects or we didn’t like the messages [00:31:51] it was posting for the reasons I said on the opportunities - because the credit wasn't going to the right people or too much information with shared - always remember when you're posting these messages, you're exceeding the front level security in your org. So if there is sensitive information, you have to think about who you're sharing that with and the content in the fields that you're sharing as well.

Host

[00:32:12] Have you ever tried any kind of integrations from Slack back into Salesforce? Like maybe posting some slacks from a channel into Slack messages into a chatter or something like that? 

Richard

You can do that. And actually the Slack app exchange app has some of that capability where you can run queries from within Slack.

[00:32:29] So for example, you can pull up an account, you can do a search, or if you're Salesforce. I’m not sure if you do any field updates, but you can do that. And the Slack API documentation has some examples in general, and I think there's some other articles out there that tell you how to do that. But I haven't done that for us because you have to think about the permission of the user who's making that call. And you're exposing potentially too much data.

[00:32:53] So do remember your data security and the profile that you used to make that connection will have that permission. 

Host 

Great. Great. Well, thanks again for presenting today. Very interesting, and could be very useful example of Apex plus Process Builder. Thank you so much. 

Richard

Thank you. Bye bye.

Integrate Your Data Today!

Try Xplenty free for 7 days. No credit card required.

About Xforce Data Summit

The Xforce Data Summit is a virtual event that features companies and experts from around the world sharing their knowledge and best practices surrounding Salesforce data and integrations. Learn more at www.xforcesummit.com.