I have create Communities and I'm trying to query to find out what are the Selected Profiles for that communities workspaces.

I was able to find the profile by querying:

SELECT Id, Name From Profile Where Name = 'Partner Community User'

But I couldn't able to find out how to find profile by Communities workspaces


Make a query on NetworkMemberGroup object.

Query all Profiles/Permission Sets related to a single community:

SELECT ParentId, Parent.Name FROM NetworkMemberGroup where NetworkId='network id'

Query all Community related to a single Profile (If profile name is provided):

SELECT NetworkId FROM NetworkMemberGroup where ParentId IN (SELECT id from Profile where profile.name = 'System Administrator')


  • how would you do the profile.name check? – Nick Kahn May 23 '18 at 23:08
  • See my updated response... U can add where parent.name = 'name of profle' – Ayub May 23 '18 at 23:10
  • Ramadan Mubark :) - Parent.Name getting error don't understand relationship Parent, I don't think we can get that in one query, needs to do it multiple query. – Nick Kahn May 23 '18 at 23:12
  • 1
    Thanks Nick. Just realized that ParentId is lookup on Profile as well as Permission set ...So does not return any specific field...You may need to do second query after getting id – Ayub May 23 '18 at 23:20
  • 1
    @NickKahn ..updated my answer to query based on profile name...Thanks for wishing Ramdan..It means a lot to me! – Ayub May 23 '18 at 23:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.