Skip to main content
Skip table of contents

getFeedItems

This command and others commands  in "SFDC Chatter" group requires additional license i.e. Dynamo Online Collaboration module needs to be enabled.

Retrieves the message contents and a large variety of other data of the posts of a specified record's Chatter feed. The value of the variable stored in the context will be a Collection of Maps, each representing one post in the feed. Each of the post-representing Maps contains a specific set of keys, behind which can be more Maps or Collections.

This command uses Salesforce's Chatter REST API (version 43) to get the feed data. At the moment, the structure of the post-representing Maps stored in the variable context is exactly as the response provided by Salesforce. Specification describing all the data that can be accessed can be found in the API documentation's Feed Item page.

The amount of data is rather large and multi-layered, so here are some EL expressions that can be used to access some commonly used data. These expressions have "feedItem" as the post-representing Map variable.

  • ${feedItem.body.text} gets the message content of the post as text. As it is pure text, formatting details such as bold or italic are not included.              

  • ${feedItem.body.html} gets the message content as HTML String that retains any rich text formatting in the message. This is a custom value created by this command by parsing the individual message segment information in the data.              

  • ${feedItem.actor.displayName} gets the name of the user who posted the message.                

  • ${feedItem.actor.photo.fullEmailPhotoUrl} and ${feedItem.actor.photo.standardEmailPhotoUrl} resolve into URLs pointing to profile images of the user who posted the message.                

  • ${feedItem.createdDate} gets a DateTime value telling when the post was posted.              

  • ${feedItem.relativeCreatedDate} resolves into a String informing when the post was posted. If it is somewhat recent, the value can be like "23h ago" while for older posts it may be like "10. January 2017 at 9:46".            

See also sfdc-chatter-doclinker content command.

Attributes

recordId

Required

Value type

EL-evaluated

Yes

String

Yes

Defines the ID of the record whose Chatter feed contents are to be retrieved.

Examples

A use for the getFeedItems command is to bring a representation of a Chatter feed on a Screen. This would retrieve the feed of the main record:

CODE
<getFeedItems var="feed" recordId="${id}">

And the following HTML on a Screen would print out the posts' contents with any rich text formatting present:

CODE
<div><p dyn-repeat="feed" dyn-repeat-var="feedItem" dyn-content="feedItem.body.html" value-type="html"></p></div>
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.