[SalesForce] Flow – Create Chatter @ Mention Post

Ok, I have my flow creating a FeedItem record but I can't get the @mention to work properly. I am posting to a Chatter Group so I can't use the ParentID field and the related to field is referencing a WorkThanks record.

In the body of the post I have this formula:
{!varMessage} & '@[' + {!WhoToThank} + ']'

WhoToThank is the ID of the user.

I get this result:
enter image description here

I assume it has something to do with my formula syntax but I don't know how to fix it.

Any ideas?

Best Answer

It's always helpful if you post images of your flow for this kind of troubleshooting. I'm assuming that you're using a record create on the feed item. Rather than this, please use the standard "Post To Chatter Action."

In the following example, I lookup my user record and then use the post to chatter action to post dynamically to my user record and @mention.

enter image description here

However, the issue that you're having here is that you're creating a record and then trying create a feed item. When you create a feed item, it will create it as plain text. Chatter posts that need at mentions must go through the streaming API, which the standard post to chatter action does. For this specific use case, you will need to create an apex plugin that does this work for you.

Related Topic