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
cupendracupendra 

How to retrieve all the hash tags used with in a group

Hi,

 

Would like to know, if there is a way to know and retrieve the has tags used within feed posts that belong to a specific group. Or a mechanism to create and store the favorites for each specific group.

 

Please do let us know, if there is any alternatives to the topics(they need not be trending topics) that are being discussed. I guess, a topic becomes a trending topic only after some number of posts or comments made with a #top or #hash_tag

 

Please help us.

 

Thanks,

Upendra

 

 

 

 

Jia HuJia Hu

You can calculate #topic by yourself.

 

Firstly, retrieve all the feedbody of a specific Chatter group, or something else,

 

Round around each feedbody, and then

 

String feedbody = '#ad#dd #3333 ## 12333#';
List<String> topics = feedbody.split('#');
Integer topiccnt = 0;
for(integer i = 0; i < topics.size(); i++) {
if( topics[i].length() > 0 ) {
topiccnt++;
}

}
System.debug(' topic count = ' + topiccnt);