When querying the PermissionSetAssignment object in Salesforce using SOQL (Structured Query Language) — for example, via Data Loader — some results in the PermissionSet.Name column appear as IDs beginning with the letter 'X' (such as X00f26000006FrycBBC or X00e20000007Fk9JAAS). These entries are not real, user-created permission sets. This article explains what these 'X'-prefixed entries represent and how to write SOQL queries that exclude them.
Example Query That Produces 'X'-Prefixed Results
Running the following SOQL query returns both permission set assignments and profile-based assignments:
SELECT Id, PermissionSetId, AssigneeId, SystemModstamp, Assignee.Name, PermissionSet.Name, Assignee.IsActive FROM PermissionSetAssignment
The PermissionSet.Name column in the results includes entries like:
Why 'X'-Prefixed Entries Appear in SOQL Query Results
In Salesforce, as of API version 25.0 and later, every user profile is internally represented by a corresponding permission set. This is because Salesforce uses permission sets as the underlying data structure for storing profile-level object permissions, field permissions, and setup entity access settings. When you query PermissionSetAssignment, the results include both user-created permission sets and these automatically generated profile-based permission sets.
Permission sets that represent profiles are identified by IDs starting with the letter 'X'. These are system-managed records and cannot be modified.
By default, every Salesforce user has at least one PermissionSetAssignment record that links them to their profile (represented as a permission set). This is expected behavior and is working as designed.
How to Query All Permission Sets (Including Profile-Based Ones)
The following SOQL query returns all permission sets, including those owned by profiles:SELECT Id, Label, ProfileId, Profile.Name FROM PermissionSet
How to Query Only User-Created Permission Sets (Excluding Profile-Based Ones)
To retrieve only permission sets that are not owned by profiles, filter by the IsOwnedByProfile field:SELECT Id, Label, ProfileId, Profile.Name, IsOwnedByProfile FROM PermissionSet WHERE IsOwnedByProfile = FALSE
How to Query Only Permission Set Assignments (Excluding Profile Assignments)
To retrieve only permission set assignments for user-created permission sets (excluding profile-based assignments), add a WHERE clause filtering on permissionSet.IsOwnedByProfile:SELECT Id, PermissionSetId, AssigneeId, SystemModstamp, Assignee.Name, PermissionSet.Name, Assignee.IsActive FROM PermissionSetAssignment WHERE permissionSet.IsOwnedByProfile = FALSE
This query returns only the permission set assignments that correspond to explicitly assigned permission sets, without including the automatically generated profile-based assignments.
• Using SOQL to Determine Your Force.com User’s Permissions
• SOAP API Developer's Guide
000387815

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.