function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Trending Topics Visualforce

So i created a custom visualforce page on Chatter Feeds, but it does not come with the trending topics. Is it possible to retrieve the trending topics? I don't mind creating a SOQL for it, but just need some direction on how to retrieve the topics.




You can use one of the ConnectApi.Topics.getTrendingTopics() Apex methods to retrieve the list of trending topics:


By any chance you can guide me on how to use this? This is my first time seeing this and not sure how it works.



So far i have create a method in my class with this:


global List <ConnectApi.Topic> getTopics(){
return null;


and unfortunately im getting a Invalid Type.


Also if I did this:

public static ConnectApi.TopicPage getTrendingTopics(communityId);


I get a unexpected token: ')'


Instead of


you need to add the namespace and class:

By the way, I forgot to mention that this Apex method requires v29.0 of the API. This corresponds to Winter '14, which is currently being rolled out. Your Salesforce instance may not be on Winter '14 yet. You can check to see when you'll be getting Winter '14 on this page:

awww man!!! i have a developer edition and im on na15, looks like i wont be able to use this functionality next month :(


Thanks alouie i'll test it out once the api 29 comes out.

Ok, sorry about that. Let me know if you run into any issues after it's available!