function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

SOQL Query for getting the number of active users assigned to a permission set

May I ask for help on how can I get the number of active users assigned to each permission set using SOQL?
Best Answer chosen by Yukinon
PriyaPriya (Salesforce Developers) 
Hey Yukinon,
SELECT count(Id) FROM PermissionSetAssignment WHERE Assignee.isActive = true and permissionSet.Name='Test_Permission'
If you want only the count, you can just use count(id) to get the count. 


Kindly mark it as the best answer if it works for you.


Thanks & Regards,

Priya Ranjan