Newer Version Available
Get Site-Specific Feed Elements from a Feed
Display a user profile feed that contains only feed elements that are scoped to a
specific Experience Cloud site. Feed elements that have a User or a Group parent record are
scoped to sites. Feed elements whose parents are record types other than User or Group are
always visible in all sites. Other parent record types could be scoped to sites in the
future.
This example calls getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, filter) to get only site-specific feed elements.
1ConnectApi.FeedElementPage fep = ConnectApi.ChatterFeeds.getFeedElementsFromFeed(Network.getNetworkId(), ConnectApi.FeedType.UserProfile, 'me', 3, ConnectApi.FeedDensity.FewerUpdates, null, null, ConnectApi.FeedSortOrder.LastModifiedDateDesc, ConnectApi.FeedFilter.CommunityScoped);