Loading

How to Determine if a Contact Is an Experience Cloud (Portal) User

Julkaisupäivä: Jun 19, 2026
Kuvaus

How to Check if a Contact Is an Experience Cloud (Portal) User

This article explains how to query Salesforce to determine whether a specific Contact record is associated with a Customer Portal or Experience Cloud user account. This is useful when troubleshooting access issues, verifying community user setup, or auditing portal user assignments.


Note: "Portal User" is legacy terminology. The current term is Experience Cloud User.

Ratkaisu

Query 1: Check a Single Contact

Use the following SOQL query in the Developer Console to check whether a specific Contact is associated with a Customer Portal User profile. Replace 003xxxxxxxxxxxxxxx with the actual Contact ID you want to check.

SELECT Id, Name, Email
FROM User
WHERE Profile.Name = 'Customer Portal User'
AND ContactId = '003xxxxxxxxxxxxxxx'

If the query returns a result, the Contact has an active portal/Experience Cloud user account. If no results are returned, the Contact is not a portal user.

Query 2: Check Multiple Contacts

To check whether multiple Contacts are portal users, use the following Apex snippet in the Developer Console's Execute Anonymous window:

List<Contact> lContacts = [SELECT Id FROM Contact];
List<User> lUsers = [SELECT Id, Contact.Id, Name, Email
FROM User
WHERE Profile.Name = 'Customer Portal User'
AND ContactId IN :lContacts];

NOTE: The first SOQL query on Contact must be scoped (filtered) to avoid hitting Apex Governor Limits. Without a WHERE clause, this query will return all Contact records and may exceed the 50,000-row Apex Governor limits. Always filter by a specific set of Contact IDs or a field condition.

Knowledge-artikkelin numero

000386163

 
Ladataan
Salesforce Help | Article