Filed away in theĀ “Why is this so hard?”, extracting a list of users related to a Public Group, Queue, or Permission Set in Salesforce.com is harder than it should be. Not in reporting and a pain with Dataloader and XLS. There are lots of workarounds and methods for doing this but it should be easy!
So here’s another workaround using public group as the example:
- Get the ID of the Group
- Fire up Workbench (https://workbench.developerforce.com/login.php)
- Queries drop down –> SOQL Queries
- Pick User to see the list of fields for reference
- Put the following in Notepad or whatever you use for scratch
- SELECT Name, FirstName, LastName, Business_Unit__c,Title, EMAIL FROM USER WHERE IsActive = TRUE AND ID IN (SELECT UserOrGroupId FROM GroupMember WHERE GroupId = ‘Group_ID’)
- If you get an error make sure your single quotes are not apostrophe’s, Evernote loves to switch those on you without asking.
- Under ‘View As’ select Bulk CSV so you can easily download/export the entire list
Nothing to interesting but doing the SOQL join can be tricky, left inner join for those keeping score.