1

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?

  • I have also tried just putting @[{!WhoToThank}] in the body and it still doesn't work. – Matt M Dec 4 '15 at 17:24
2

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.

1

You have to put square brackets around the id of the user. @[UserId] This one got me because it's not immediately obvious from looking at the help article here, but that's the trick, square brackets around the ID.

Below is an example I just tested in a process builder chat mention and works perfectly:

@[{![Task].Owner:User.Id}] This task is over 90 days old and has been closed as abandoned. It will no longer appear as an open task. To re-open it, set the due date in the future.

Mark as solved to make this easy to find! 

0

Is the WhoToThank record a user or a salesforce record? If it is a record Id then you need to reference the user associated with that record. try something like this..

can you try @[{![WhoToThank].UserId__c}]

  • The WhoToThank value is the ID of the user. – Matt M Dec 4 '15 at 19:03
  • Have you tried @{!WhoToThank} – Benjamin Pirih Dec 4 '15 at 19:05
  • Yep, anything I try just keeps getting turned into a string. – Matt M Dec 4 '15 at 19:08
  • Looks like this won't work. SF has a custom action for performing an @mention which doesn't help me as I need to set the relatedto and parentid values. – Matt M Dec 4 '15 at 19:30
  • help.salesforce.com/… – Matt M Dec 4 '15 at 19:30
0

You have to do this in Process Builder, not Flow. Unless there has been a change you can't get the @MentionUserName to work in Flow. Process Builder has a different UI for when you post to chatter.

You might have to do some sort of Process Builder --> Flow --> Process Builder process to get the Flow to trigger your second Process Builder that makes the post based on the data you are updating. But, I am not sure what is going on in your Flow to say for sure -- or if you could do it all within Process Builder (as it looks like you might)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.