I've created a workflow using the process builder and added a Chatter Post as an action. How Can I add a link to that post, a link which people can click and go to a SF record?


2 Answers 2


I was able to manually build up the required URL to the record that started the process.

enter image description here

Here I created the link as:


You will need to change the na5 subdomain in the URL to match your instance.

This appeared in the chatter post as a link that I could follow back to the originating Account.

enter image description here

  • 3
    But hardcoding the URL in the post defeats the purpose. I have to move the process from sandbox to production. This will not change the URL dunamically. There should be a dynamic solution to this problem.
    – Sam
    Sep 16, 2015 at 10:46
  • @sam -- you might be able to use the ol' base URL formula trick: LEFT($Api.Partner_Server_URL_260, FIND( '/services', $Api.Partner_Server_URL_260)) Sep 25, 2015 at 16:03

I managed to implement a solution for this, but it's a bit long to post it here in fullness. The bottom line is that I added some additional functionality to Salesforce ConnectApiHelper class to support linking to records using the new Summer '18 class ConnectApi.EntityLinkSegmentInput. With this change you can now create hyperlinks simply by putting the record ID between the curly brackets likes so:

Hi {SOME_USER_ID}, your Opportunity {SOME_OPPORTUNITY_ID} has been updated.

I also implemented an InvocableMethod so that you can call it from Process Builder or Flow. The end result was that now I can create Chatter Posts like the one below directly from Process Builder:

enter image description here

You can find the code you need at my GitHub repo, and the detailed instructions on how to use it here at my blog post.

  • Good blog post, but I couldn't get it to work in a Flow. I just need to get a live line to a Contact record -- ideally the Chatter post would have the Contact's name, not the ID. Any tips? Sep 10, 2018 at 18:59
  • Hi @PatMcClellan__c, it should be straightforward. Try adding a PostToChatterAction to your flow and in the Message property write something like this: Hello {{!My_Contact_Record_Id}}.. In the Subject Id put a record ID where you want the chatter post to appear. It can even be the same {!My_Contact_Record_Id}. Let me know if you are still having troubles?
    – smukov
    Sep 10, 2018 at 20:59
  • No, it doesn't put the link in -- just inserts the actual record id. "Hello from {0036A00000RPeqbQAD}". What I need is "Hello from Carole White" -- with a hyperlink on Carole White that leads to record 0036A00000RPeqbQAD in Contacts. Sep 11, 2018 at 16:56
  • Hmm, I actually tried this last night before answering, and I got a nice hyperlink. Could it be that you are on Winter '19? Because the org I tried it on is still on Summer.
    – smukov
    Sep 11, 2018 at 16:59
  • No, still Summer. Sep 11, 2018 at 17:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .