Retrieving a specific portal user in Zoho CRM is most reliably done through the $Crm.user object available in Client Scripts, which exposes the full identity and role details of whoever is currently logged in to the portal.
Why this matters
When you build a Zoho CRM Portal for customers or partners, you often need to personalise the experience — showing only relevant records, enforcing field-level rules, or branching logic based on who is viewing the page. Knowing how to programmatically retrieve the current portal user's details lets you tailor Client Scripts to individual users or entire user types without duplicating code. This is especially useful in vertical solutions where different portal profiles need different behaviour. [1]
Step-by-step
Step 1. Confirm that Client Script support for Portals is enabled in your Zoho CRM organisation. This feature has been rolled out across all data centres, so it should be available by default — but verify it is active under your developer or portal settings before writing any script. [1]
Step 2. Open the Client Script editor for your portal. Because existing Client Scripts automatically extend into portals, you do not need to create a brand-new script from scratch. Any script you have already written will function within the portal context without rewriting or duplicating it. [1]
Step 3. Inside your Client Script, call $Crm.user to retrieve the details of the currently authenticated user. This single object returns all the identity fields you need for conditional logic. [1]
Step 4. Inspect the type field returned by $Crm.user to distinguish between a regular CRM user and a portal user. A standard internal user returns "type": "Regular User", while a customer-facing portal account returns "type": "Client Portal User". [1]
Step 5. Use the remaining fields from the $Crm.user response to identify the specific individual. The object includes:
id— the unique CRM record ID for the userzuid— the Zoho user ID tied to their Zoho accountfullname,firstname,last_name— display name fieldsemail— the user's registered email addressprofile.idandprofile.name— the portal profile assigned (e.g.,"ClientPortal")role.idandrole.name— the role assigned within the portal (e.g.,"Portal User") [1]
Step 6. To target a *specific* portal user in your script logic, compare the id, email, or zuid value from $Crm.user against a known value. For example, you can branch your script so that certain field validations or UI changes only apply when $Crm.user.email matches a particular address. [1]
Step 7. To target an entire *user type* rather than one individual, check $Crm.user.type. When the value equals "Client Portal User", you know the viewer is a portal participant rather than an internal team member, and you can apply portal-wide customisations accordingly. [1]
Step 8. If you need to manage portal users outside of scripts — for example, to activate, deactivate, or remove a user — navigate to Custom Portals, open the relevant portal, go to the Users tab, locate the user's email address, and click the More Options icon to choose the appropriate action. [7]
Common pitfalls
- Confusing
idwithzuid: Theidfield is the CRM-internal record identifier, whilezuidis the cross-product Zoho account identifier. Useidwhen querying CRM records andzuidwhen you need to correlate across Zoho services. [1] - Assuming all users are portal users: If your script runs in both the standard CRM interface and the portal, always check
$Crm.user.typebefore applying portal-specific logic. Applying portal rules to a"Regular User"can cause unexpected behaviour. [1] - Profile vs. role confusion: The
profileobject reflects the portal profile (controlling which modules are visible), whilerolereflects the user's position in the portal hierarchy. These are separate concepts — do not use them interchangeably when writing conditional logic. [1] - Invitations vs. active users: A user who has been invited but has not yet accepted will not appear in the active Users tab. Check the Invitations tab if a user you expect to find is missing from the list. [7]
What to check
- Verify that
$Crm.user.typereturns"Client Portal User"when you preview the portal as a test portal account, confirming the script is executing in the correct context. [1] - Confirm the
profile.nameandrole.namevalues match the portal profile and role you configured for that user in the portal settings. [1] - After any user management action (activate, deactivate, remove), return to the Users tab in the Custom Portals section to confirm the change is reflected in the user list. [7]
---
*Beam Help is an independent expert support resource for Zoho products and is not official Zoho support. Always test Client Script changes in a sandbox or developer environment before deploying to production.*