Overview
A Public Group in Salesforce is a named collection of users, roles, and other groups that administrators create to simplify record sharing, folder access, and permissions management. Instead of managing access at an individual user level, you can grant access to the whole group, making security and collaboration simpler and more scalable.
When and why to use Public Groups
Public Groups are useful for:
- Sharing rules — Use groups to define who should receive automatic record access.
- Folder and report access — Give a set of users access to reports and folders.
- Queue and approval processes — Add groups where a group needs visibility or approval rights.
- Manual record sharing — Quickly share a record with multiple users at once by selecting a group.
Key characteristics
Important points about Public Groups:
- Members can include individual users, roles, subordinates, and other groups.
- Groups are maintained by administrators through Setup > Users > Public Groups.
- Groups are assigned a Group record in the database (Group object).
- They are different from Roles and Permission Sets — groups are for grouping users, not for assigning granular permissions directly.
Example: Group object and programmatic access
Salesforce represents Public Groups with the Group object, and group membership with the GroupMember object. Example SOQL and Apex snippets:
SELECT Id, Name, Type FROM Group WHERE Type = 'Regular' AND Name = 'My Public Group' LIMIT 1
Apex example to add the current user to a public group:
Group g = [SELECT Id FROM Group WHERE Name = 'My Public Group' LIMIT 1];
GroupMember gm = new GroupMember();
gm.GroupId = g.Id;
gm.UserOrGroupId = UserInfo.getUserId();
insert gm;
Public Group vs Role vs Queue
Understanding differences:
- Public Group — flexible collection of users, roles, and other groups primarily used for sharing and visibility.
- Role — part of the role hierarchy that affects record-level access via the role hierarchy (used for manager-subordinate visibility).
- Queue — used for ownership and work distribution (mainly for Leads, Cases, custom objects). Queues have members but are focused on record ownership and assignment rather than broad sharing.
Best practices
- Use descriptive names for groups (e.g., Sales_APAC_Managers) so purpose is clear.
- Keep group membership documented and review periodically to remove stale members.
- Prefer groups over ad-hoc manual sharing when many users need the same access.
- Combine groups with sharing rules to automate access — this reduces manual sharing and administrative overhead.
Summary
Public Groups are a core Salesforce construct for aggregating users and roles to simplify sharing, folder/report access, approvals, and assignment rules. They improve maintainability and reduce complexity when granting the same access to multiple people.




Leave a Reply