CRMSalesforce CRM

Get a list of Public Groups in Your Organizations

By November 22, 2020No Comments

The Group object cannot be reported on.  You can view and edit the lists from Setup but you can pull a list in Salesforce Developer Console that will include the members of each Group.

To open the Developer Console, click on Setup (gear icon) and choose Developer Console.  Be sure the Query Editor tab is highlighted.

Here are some SOQL queries to help:

Get All Group Names

Enter the following in the Query Editor.

Select ID, Group.name from Group where type = ‘Regular’

Click the Execute button

Get User Information for All Members of a Group

Enter the following in the Query Editor and replace <GroupName> with the name of your Public Group.

select id, name, email, isactive, profile.name, userrole.name, usertype

from user

where id in

(select userorgroupid from groupmember where group.name = ‘<Group Name>’)

Click the Execute button.

Get All Groups for a User

Enter the following in the Query Editor and replace <Username> with the name of the user.

SELECT Id, Group.name

FROM GroupMember

WHERE UserOrGroupId IN (SELECT Id FROM User where name = ‘<UserName>’)

Click the Execute button.

Becci MG

Author Becci MG

More posts by Becci MG

Leave a Reply

Questions about Salesforce?


Email Gene directly at gene@marksgroup.net!

EMAIL GENE NOW