How to include `metadata` in group channel list?

Hi! I am using this on retrieving group channel list, how can access meta data of each group channel?

var listQuery = sb.GroupChannel.createMyGroupChannelListQuery();
listQuery.includeMetaData = true;

listQuery.next(function(groupChannels, error) {
    groupChannels.forEach(channel => {
        // access metadata here
    });
});

includeMetaData doesn’t seem works, and if I use getMetaData I should do an API call each item on list which will be an issue if there are a lot of channel on the list

Hi, @holale

Could be this what you’re looking for?

Hi @walter.rodriguez,

if I am using getCachedMetaData, am I will always get the latest value when I am doing this query?

listQuery.next(function(groupChannels, error) {
    groupChannels.forEach(channel => {
        const metadata = channel.getCachedMetaData();
        // this metadata is the latest value
    });
});

You should, yes.
Let us know if any problem :slight_smile:

Okay, I think this is resolved, thank you @walter.rodriguez

1 Like