Iâve always found Zapier to be a cool tool, but never thought of an application to use it at Industry Dive. My colleague had set up a few Zaps between Google Sheets & Salesforce and had showed me the gist of Zapier, which got my wheels turning.
Then, this happened in our sales chat:
I mean, #duh.
Spoiler Alert:Â This post is not about how I managed to get specific songs to play from Spotify to Sonos. Weâre still using a human for that part of the equationâââbut if you have ideas, let me know in the comments! đľ
We quickly polled the sales team to get everyoneâs favorite song. Given that we didnât want complete chaos on the Sonos we decided to limit playing a repâs song to closed won deals over $15,000. This happens just infrequently enough that it would be special.
So here is where Zapier comes in: How could we notify the team in our HipChat room the second a deal was closed that met that criteria? A simple Workflow Rule in Salesforce would allow me to email the team, but a HipChat is exponentially more fun. đŹ
Assumptions
Before following the below instructions, make sure you have the following or else youâll just get frustrated.
A paid subscription to Zapier. Salesforce is a âpremiumâ application which means you canât access it on Zapierâs free plan.A System Admin profile or Modify All Data permissions in Salesforce. Or, just send this to your friendly Salesforce admin, Iâm sure sheâd be happy to set this up for you. âď¸Ability to get the an Admin Auth Token from HipChat. This is what Zapier uses to âcallâ HipChat and access the HipChat room you want to message. This was the piece of the puzzle I didnât have access to so I just hunted down one of our HipChat admins, asked them the generate the token and then send to me.
Step 1: Open up Salesforce & Zapier and set up the Outbound Message
If you have dual monitors, this will make it a lot easier so that you can flip between the two apps.
In Zapier create a new Zap and select Salesforce then type in âOutboundâ into the Salesforce Trigger search. Youâll then be asked to connect your Salesforce instance to Zapier, so go ahead and do that if you havenât already.
The next step will be to get this webhook, which is what allows Salesforce and Zapier to âtalk.â Keep this page open and switch to a new tab to Salesforce.
In Salesforce, create an Outbound Message. The object youâll want to create it on is Opportunity, because that where closed won sales happen! But you can see you can create an Outbound Message on almost any object.
Put the URL from the Zapier screen above into the Endpoint URL field in Salesforce.
The âOpportunity fields to sendâ section is important because that is the information you are sending back to Zapier, which will ultimately become part of the message you send to HipChat.
Side note:Â Youâll see that Account Name and Owner Name arenât available options to pull over. This is why Iâm bringing the IDs. Weâll convert them over to text in a later step.
Once you do this press Save on the Salesforce screen and save on Zapier. At this point, Zapier will want to pull in examples using the webhook you just added.
Youâll get something like this:
Allll the Salesforce IDs. đ˘
Step 2: Go back to Salesforce and set up a Workflow Rule
The Outbound Message is what sends all the relevant information to Zapier but something needs to kick off the Outbound Message. An Outbound Message on its own does nothing. Enter: Workflow Rule!
Create a new Workflow Rule that has the criteria you want to trigger to the Outbound Message. My criteria is fairly simple: Closed Won & over $15K.
Once you save your Workflow Rule, make sure to add an Immediate Workflow Action (choose: New Outbound Message) which is triggering your Outbound Message. Basically, youâre linking the two actions together. Otherwise, nothing will happen!
đĄAdmin Best Practice Side Note: I named both my Outbound Message and Workflow Rule âOver $15K for Zapier.â I also utilized the description field to explain what these actions do. When youâre stringing together different components within the system naming consistency is helpful because it shows you (and future admins!) that all these parts are related.
Before we delve into Step 3, letâs briefly cover what we did:
Set up an Outbound Message from Salesforce to Zapier, which sends the relevant data from Salesforce to Zapier (which will eventually be passed to HipChat).Set up a Workflow Rule to push that information out of Salesforce based on specific criteria (since I donât want to send a HipChat for every single sale!)
Next Steps: Use the IDs from the Outbound Message to get the text you want to include in your HipChat
This really puzzled me initially. In the screenshot above with all the Salesforce IDs youâll note that that the only thing that is legible is the amount: 5000.00. Everything else is in Salesforce ID form. But when you go to set up your Outbound Message you donât see an option to select âAccountâ just âAccount ID.â Hmm. đ¤
So at first I just ignored this and plowed straight ahead into the HipChat portion of the Zap. This is what I got:
Yike.
Okay, fine. I should probably figure out a more legible solution. At this point I hadnât thought to read Zapier documentation, so I just turned to Twitter instead.
Initially I thought Iâd create formula fields that would be hidden on the page layout in Salesforce so that I could pull the information over to Zapier. My heart secretly ached at the idea of creating extra fields for such a silly purpose. But then! A response!
Brilliant! Instead of creating these fields, I would just create steps in Zapier to search for the information I wanted in Salesforce and then bring it back to Zapier in the format that I wanted. I had to create a lot more steps in Zapier, but this way everything was self-contained in Zapier and I wasnât spinning up random fields in Salesforce.
It does seem a little circular; you just called all this information from Salesforce to Zapier and now youâre sending it back to Salesforce just for the purpose of reformatting it. But since you only have IDs for these objects and nothing more, you need to query Salesforce so you can get all the fields so your HipChat message isnât gibberish.
Step 3: Find Account
In Zapier, create a new step after your Outbound Message. Select Action, then Salesforce, and then âFind an Account.â
Youâre searching by the Account ID you got in Step 1!
Select Account ID and then Notification S Object Account ID. Then follow the rest of the prompts.
Donât worry about Account Name and other text yet! That will come later.
Step 4: Find User
This is pretty much the same as above, but instead of âFind an Accountâ youâll choose âFind a Custom Object.â The User object is not a Custom Object, but thatâs what Zapier calls anything that they donât have in their system.
This is the User ID for the Opportunity Owner and how youâll get their name.
This is what your steps in Zapier should look like so far:
Step 5: Format Currency
This is 100% optional but if youâre going to do a job you might as well do it well, right? In your Outbound Message Salesforce gives you the amount of the opportunity in this format: 50000.00. No dollar sign, no comma. Not ideal.đ°
Luckily, Zapier has a solution for this called âFormatterâ that will transform the number for you. Create a new Action and search for Formatter. Choose Numbers and on the next screen youâll be presented with this:
The Currency Format part still confuses me a bit.
Your input is the amount that came over in the Outbound Message.
Youâll then get an option to test the results of the formatting. If it doesnât look how you want it, go back to the previous screen and fiddle with the Currency Format options until you get what you want.
Step 6: String it all together to create your HipChat message! đ
Okay, youâve told Salesforce to send information to Zapier, youâve searched Salesforce for the correct information you want to render in your chat and you reformatted the currency because youâre an overachiever. đ Letâs finally put it all together and send a HipChat message!
Back to Zapier: Create a new action, search for HipChat, and select âSend Message.â
Youâll need to connect HipChat and Zapier so this is where that Admin Auth Token will come in handy. Grab that and youâre ready to rock and roll.
Next comes the fun part: Setting up the template!
Room:Â The HipChat room you want to send the message to (when you are first setting this up and testing it, I recommend making a private room or sending the chats to a less populated room.)
From: This is just a free form text field and you can make it whatever you want. I thought Opportunity Bot was cute so thatâs what I went with. đ¤ (Too bad I canât add emojis in Zapier/HipChat because otherwise I totally would)
Message:Â Here is the what we all came for and the purpose of all those darn searches. You can now craft your message and pull information from each search step.
Basically an elaborate mail merge. đŠ
I just wanted account name and user name but because you pulled in the entirety of the Account and User objects, you could pull in whatever you wantâââuser title or maybe account phone? Really, the possibilities are endless.
Notify, Color, and Format:Â All pretty straight forwardâââmake the choice that is right for you.
Before going live, I recommend sending a couple tests to a test HipChat room to make sure your chat is exactly how you want it.
Once youâre happy, change the HipChat room to real room you want to send the chats to and donât forget to turn on your Zap!
Step 7: Wait for the sales to roll in
End of quarter sales has the Opportunity Bot working overtime. đ
The best part of the Outbound Message is that itâs instantaneous! This is because Salesforce is pushing information to Zapier vs. asking Zapier to search your Salesforce instance. So the second a rep closes a deal, youâll see it in HipChat.
Did you try this? Or have an idea on how it could be better? Leave a comment below or find me on Twitter. Iâm always looking to meet other Salesforce enthusiasts. âď¸