+ Start a Discussion
Kapil KaushikKapil Kaushik 

Is there any way to get All users of a Public group ?

I want to get the Users which comes under the Roles, Roles & Subordinates and Public Groups of a Public group.
Is there any standard SObject from which we can query all users of a Public group OR I should write the complete logic of it. Please share your experience. 

Thanks
Kapil Kaushik
Anil kumar GorantalaAnil kumar Gorantala
use 
SELECT Id,Name FROM Group WHERE Name LIKE '%U%' OR Name LIKE '%r%'

to get some group id you wanted then

use 
SELECT GroupId,Id,UserOrGroupId FROM GroupMember WHERE GroupId = '00G28000000OHo8EAG'

to get list of members which is given by Id in second soql