Posting Survey Link to Feed with Action Link Template

In this blog, I am going to explain how to set up survey link to the chatter feed by using action link template.Here we are going to use Action Link Template Action type “UI”  .UI Action will take the user to a Web page to the action URL. Here I am using SurveyMonkey survey link URL.

Please refer this link for more information on Action link templates Inside Action Link Templates

Step 1: Create the Action Link Templates

Action link templates is a group of Actions that is going to be associated with the chatter feed. To create an Action link template From Setup, enter Action Link Templates in the Quick Find box, then select Action Link Templates. Click on New button then add the values in a new Action Link Group Template as shown below then save it.

Name Complete Survey
Developer Name Complete_Survey
Category Primary action
Executions Allowed Once per User


Now you create an Action Link Group Template . after that you can associate one or more action link templates.The action link template is automatically associated with an action link group template in a master-detail relationship. Add new action link template under the Action Link group template as shown below.


Action Type: UI
Action URL{!Bindings.surveylinkId}
User Visibility Everyone can see
Position 0
Label Key – none
Label: Complete Survey

Now go to Action Link Group Template Detail Click on Edit then Check “Published” checkbox checked and save it. So that you can instantiate action line template group

Step 2: Get the Action Link Group Template ID

You need to get the previously defined action link template group Id. You can get in different ways like SOQL, Rest API or you can take from the URL. Action Link Template Group Object is Queriable so you can use simple SOQL as shown below

SELECT id FROM ActionLinkGroupTemplate WHERE DeveloperName=’Complete_Survey’


Step 3: Instantiate the Action Link Group

You can instantiate the action link group by Using rest API or Apex Code. But in this case, I am using rest API along with workbench for rest API.

Login into workbench by using URL. Go to Utilities -> rest explorer
End Point URL :- /services/data/v39.0/connect/action-link-group-definitions
Select operation as POST and Use the Body as shown below


If you can see above JSON is contacting the Action Linke Group Template Id and the array of TemplateBindings.  template bindings are contained key and values. Key should match with the action link template bindings variable reference and values is the corresponding values.{!Bindings.surveylinkId} === >  {

{!Bindings.surveylinkId} === >  {


Click  on Execute now after that you see the JSON response as shown below which contains Action link id which you need to pass the Feed Element in next step


Step 4: Associate the Action Link Group with a Feed Element and Post It

Now in this step, you are going to create chatter feed and posting to the chatter. You can do it by using apex or rest API. here I am going to use rest API with workbench again.

Go to Utilities -> rest explorer
End Point URL :-/services/data/v39.0/chatter/feed-elements
Select operation as POST and Use the Body as shown below.


"body": {
"messageSegments": [
"type": "Text",
"text": "Please complete this Survey"
"subjectId": "me",
"feedElementType": "FeedItem",
"capabilities": {
"associatedActions": {
"actionLinkGroupIds": ["0Ag410000004cDwCAI"]


Now you can see the above request body is contains action link group id instance which you got in earlier steps.



Click on Execute now. It will create a  new chatter feed post with action links as shown below.


On lick on of Complete Survey button, it will take you to the Survey link URL.