Post Rich Chatter – Process Action

This action posts to chatter in a way similar to the built-in Post to Chatter action. It supports the subset of rich text that Chatter supports. You can pass it a Text Template with rich text formatting, or simply provide it with some HTML text.

This is an invocable action, also known as a process action, and runs in Flow Builder, Process Builder, Bot Builder, and Strategy Builder.

Handling is as follows:

Bold, Underline, List (Bullets and Numbers), Italics get displayed in Chatter without any modification.

URLs and Images get displayed in Chatter but are modified. Both are rendered in Chatter as clickable links (there’s probably a way to improve this action’s Apex to display these more effectively inline, if there are any Apex Chatter experts out there reading this).

Formatting Support

The following rich text formatting elements available in Flow are not supported in Chatter, so they get stripped out:

  • Indenting
  • Font Size
  • Font Family
  • Font Color

AttributeTypeNotes
bodyStringCan be HTML, which also means a Flow Text Template with formatting. See documentation for information on how various formatting is affected.
targetIdStringCan be the id of a User or Group, the string ‘me’ (which represents the current user) or the name of a user or group. The action will first try and match this value to a known name and then assume it’s an Id.
communityIdStringIf null, the user’s current community is used.

Support for @Mentions

This action will attempt to convert any recordId it sees in the Body that is in braces to an @mention. So if you put this in a Flow Text Template:

Hey! {{!curGroup}}

and curGroup is a flow variable of type Text that contains a recordId, you’ll get an @mention in the Chatter:

Installation

Unmanaged Package V1.0

Source Code

View Source

Credits

This action makes extensive use of ConnectionApiHelper.

0 0 vote
Article Rating
Subscribe
Notify of
guest
8 Comments
Inline Feedbacks
View all comments
Jonathan Stringer
2 months ago

So when I post to a customer using a community ID the customer gets two Chatter posts, One from the Post Rich Chatter – Process Action and the other from SF standard Chatter post because the system is reading the Salutation username as an @mention despite it NOT being in double curly brackets. So this {!looprecord.Owner:User.FirstName} is generating an @mention. Is there way of avoiding the double post?

Jonathan Stringer
2 months ago

by the way, it doesn’t do this for a regular employee user

Jonathan Stringer
2 months ago

Hi Alex
I am attempting to use this in combination with a text template. But the Post Rich Chatter – Process Action is NOT processing it is just displaying them, literally as , rather than leaving a nice blank line. Is this expected?

Jonathan Stringer
2 months ago

Ha, now that’s funny, the comment field stripped out the “” so I’m trying in quotes

Jonathan Stringer
2 months ago

Ok so quotes didn’t work I guess I will remove the brcaket.

Hi Alex
I am attempting to use this in combination with a text template. But the Post Rich Chatter – Process Action is NOT processing BR it is just displaying them, literally as BR, rather than leaving a nice blank line. Is this expected?

Alex Edelstein
Admin
2 months ago

With the exception of the specific items documented above, html tags are not supported in Chatter.

Jonathan Stringer
2 months ago

Would you consider bulkingfying this? I am currently using it inside a loop to send a bunch of notifications and had to split out the flow to get an increase SOQL queries. It would be fab if we could assign a collection to the id.

Alex Edelstein
Admin
2 months ago

Yes, have put this on the list