This post is inspired by James Goerke who wanted to automatically create Cases based on Chatter posts or comments with specific hashtags (aka Topics).

james_goerke_tweet_create_case_from_chatter_topic

When I saw James’ tweet I immediately thought of my best friend Zach Boyd who had shared with me at Dreamforce about how he had just implemented the same solution at his company. So naturally I bring Zach into the conversation!

james_goerke_tweet_create_case_from_chatter_topic_intro_zach_boyd

To which James lovingly threw a wrench into the equation by clarifying that the ideal solution would allow him to work his magic without resorting to writing Apex code.

james_goerke_tweet_create_case_from_chatter_topic_without_apex

At the time of this writing, although Process Builder does support FeedItem object, Process Builder does not support either TopicAssignment or FeedComment. The lack of support for those two objects is important because if the #hashtag is added to the Chatter conversation in a comment then there is no way to detect this with just Process Builder.

You can support our cause by voting for the following on the IdeaExchange:

But before we get too far into this, let’s take a moment to understand the role of #hashtags in Chatter posts and comments and how they are connected to Topics as this influences our final solution.

What are Chatter Topics / Hashtags?

Topics are a way to tag and organize Chatter conversations, very similar to how you may use #hashtags on Twitter or other social media sites. To assign a topic to a Chatter post, you can (in Classic, Topics not supported in Lightning as of Winter ’16, vote here):

  1. Simply use #hashtag where hashtag is the name of the topic to assign, or
  2. Click the auto-prompt link Click to add topics shown after creating a post, or
  3. Use the Add Topics menu option on any existing Chatter post

chatter_3_ways_to_add_topics

Therefore, using #hashtags is really under the sheets assigning a topic to the Chatter post. And this topic assignment can occur at the time the post is made, at the time a comment is made, or arbitrarily by a user using the Add Topics menu. Very quickly we see that if we designed a solution using just Process Builder that only supports FeedItem object then we are only supporting one of the three ways the topic can be assigned. And well, if we’re going to do this then we’re going to do this right!

lets_do_this

Wait, don’t we have Quick Actions for this, why support Chatter Topics?

Correct you are, we do have the New Case Quick Action that can be exposed in the Chatter Publisher. Actions are very powerful and let us do many things directly from Chatter, and like all tools they have their time and place.

new_case_quick_action_chatter

However, using Topics is arguably more convenient for your users (read: higher user adoption rate) than global or object Quick Actions (even though Actions are right there in the Chatter Feed too).

When your users are confronted with choosing between either filling out a form or simply using a #hashtag to get what they need, well, I have to tell you that people will almost always choose the path of least resistance.

path-of-least-resistance

But convenience for creating a Case is just the tip of the iceberg here. What we’re really talking about is revolutionary.

Automating actions from Chatter Topic Assignment, or more generically from Chatter posts and comments, opens up a new channel for your users to getting work done in Salesforce.

Perhaps you want to auto-escalate cases with #escalate topic, or auto-convert leads with #convert topic. And your users don’t have to be in Salesforce to assign these topics, they can reply to a Chatter notification email with the #topic too to drive business automation! Check out this Dreamforce session video Enhance the Feed with Chatter Topics and Apex Triggers for more inspiration and possibilities.

Introducing Chatter Bot for Topics

Chatter Bot for Topics is a way to easily listen for topic assignments to a Chatter post then take action using Process Builder or Flow.

The solution, available on GitHub, includes two custom objects and one apex trigger on TopicAssignment. Major kudos to Zach Boyd for wrangling the trigger and coming up with this design.

As the administrator, you create a Chatter Bot Topic record for each topic you want to support. For example “help”, “escalate”, or “convert”. When a user assigns that topic to a Chatter post or comment then the trigger inserts a record into the Chatter Bot Topic Assignment object. At this point, you can use Process Builder to fire when these Chatter Bot Topic Assignment records are created and perform your business automation like creating cases, converting leads, and much more!

Check out the video tutorials at the end of this article to see how easy it is to get started!

chatter_bot_topic_assignments_1

chatter_bot_topic_assignments_2

The Future is a Smarter CRM

In their simplest form, bots are just another extension of automation on the Salesforce platform. But couple this with Artificial Intelligence, like Salesforce Einstein, machine learning, or natural language processing, and you’ve got the recipe for a smarter CRM and more productive workforce.

Check out these resources to learn more about this revolution:

Chatter Bot for Topics Video Tutorials

Learn how to quickly create a new case on topic assignment using just Process Builder.

Learn how to create a new case and post comment back with link to that case using Flow.