Scenario:I wanted to create several public groups based on some criteria (in my case, I was using email domain). I discovered that was pretty much impossible in Setup. I was only seeing an option for creating a group and then adding users manually or by role/profile.
- I created my groups in Setup. I don't think you can create a group without a single member, so I added someone I knew would be included anyway based on my criteria.
- I exported a query of all my active users as a csv (I used LexiLoader but Workbench would work great too).
Select Id, LastName, FirstName, Email FROM User WHERE IsActive = True
- I opened my csv in Excel and sorted it by the field I wanted to use to segment my groups and added a column for Group ID.
- I copied the id from the url for each newly created group.
- I pasted the group id into my sorted csv for each user as I wanted to segment them in my groups.
- I did a 'save as' on my csv.
- I used workbench to upload the file in the GroupMembers object.
Ta da! Done! Perfect!
This process was much easier for me than trying to manually add the users to these new groups.
I haven't used Workbench that much in the past but I'm realizing that it is pretty stinkin' handy. I've been a bit frustrated with LexiLoader lately (which is the Mac version of DataLoader) and I often miss the Excel Connector (which is only for Windows OS) but even that had its flaws.
And that's all for today... until I finish those almost done blog posts that are glaring at me.