This is my very first post and I would like to present an interesting way to create a case from a chatter post automatically. To do this I have used the following three main components.
- Lightning Process Builder
- Quick Actions
- Workflow Rules & Field Update
What if you wanted a Case record to be created automatically once someone posts on chatter by including #needhelp in the post itself? In the following example, I will use a process builder flow to create a case through quick actions once a chatter post has been created with #needhelp in the body of the post within a feed on account records.
Before the Process Builder Flow can be created I had to create a few items beforehand.
- Long Text Area custom field on Case object to replace the standard Description field. The body of the feed item will be used as the description and it can be longer than the 255 characters limitation of the standard field. In this example, I’ve created a custom field labeled as Case Description.
- I created an Account action that creates a Case record. I’ve added Status, Subject, and the custom Case Description field to the layout. I will use this action with the process builder flow to create the case. You can also use the Create record action in the flow as well, but the account action will allow the default of a specific case record type. Using the Create record option will require you to specify the record type id explicitly.
- Last item was to create a workflow rule and field update to auto-populate the case subject. As there won’t be a way for someone to specify a case subject via the chatter post, it can be helpful to populated that it is a case create from a chatter post and perhaps the account name. I am hoping there will be a way to set text fields via formula instead of using text literals or referencing a value from the object records in process builder in the future.
Now for the part that involves Lightning Process Builder, which has the capability of executing actions based on the FeedItem object. In the flow’s action group, I will set the following criteria (see screen shot).
To only create case records from chatter posts from the feed of an account records, I whether or not the ParentId of the FeedItem record starts with ‘001’. If you want to limit case creation from the feed of other standard or custom object records only, you can use the same condition and change the value for the object in your org. For any objects that do not have a standard lookup field on the case object already, a custom lookup needs to be created.
I also check for the string ‘#needhelp’ in the Body of the FeedItem record. You can use any type of hash tag or any other string value to trigger the case creation, but it probably should be simple enough for your users to remember and use.
As mentioned earlier, the flow action will involve using the Account quick action I created. The following quick action variables were set.
- Record Related Id: Set to the FeedItem’s ParentId field, which will be the account record id and will be stored in the Case.AccountId field.
- Status: I defaulted it to New, but can be any value.
- Case Description: Set to the Body of the Feed Item.
- Subject: I set a generic subject here, but the subject will be modified to the convention configured in the workflow rule + field update mentioned earlier
Below are example screen shots of the chatter post with #needhelp and the resulting case that is created.
Well, this is my first post, hope you find this helpful or at least interesting. I am hoping I will have the opportunity to post more soon.