Suppose we need to find out which all permission sets have a particular custom metadata access enabled. For this, first we need to find out the object Id of the custom metadata and using that object id we can get the list of permission sets. In this example, first we are getting the object id of the custom metadata. This can be obtained either from the url or by querying the CustomObject as below: SELECT Id FROM CustomObject WHERE DeveloperName='Parent_Metadata' Next, we query on SetupEntityAccess like below: SELECT Id, Parent.name, SetupEntityId, SetupEntityType, SystemModstamp FROM SetupEntityAccess WHERE parent.isownedbyprofile=False AND SetupEntityId IN ('01I6F000003cdLBUAY')