+ Start a Discussion

SOQL on Chatter

Can some one would help me on-  What is the SOQL for retrieving the list of Users who are Moderators in a Private or Public Group?

Andy BoettcherAndy Boettcher
You're looking at the CollaborationGroupMember table - check and try this out first, let us know if you need further assistance.

Hey Andy,
I have read that but did not get much luck.
My use case is- In our organization there are various Private Groups are there. I need to know who are Moderators,owners and Managers are there for each Private and Public Group.

Basically, I am looking for the SOQL query. 

Andy BoettcherAndy Boettcher
The CollaborationGroupMember table has CollaborationGroupId (your chatter group) and CollaborationRole, a picklist of "Standard" and "Admin".  "Admin" = Manager.

The "Owner" of the group is the CollaborationGroup.OwnerId.

SOQL would roughly be SELECT Id, Owner.Name, (SELECT MemberId, CollaborationRole FROM CollaborationGroupMembers)