Experience Cloud, Analytics & AI
📖 Concept
Beyond Sales and Service, Salesforce offers specialized clouds and products that developers need to understand for enterprise solutions.
Experience Cloud (formerly Community Cloud):
- Build portals, forums, and sites for external users
- Customer portals, partner portals, help centers
- Uses Lightning Web Components and Aura
- Guest user access (unauthenticated)
- Full CRM integration (cases, knowledge, orders)
- Custom authentication and branding
CRM Analytics (formerly Tableau CRM / Einstein Analytics):
- Advanced analytics and BI built on Salesforce data
- Dashboards, lenses, and datasets
- SAQL (Salesforce Analytics Query Language)
- Predictive analytics with Einstein Discovery
- Embeddable in Lightning pages
Einstein AI Features:
- Einstein Lead Scoring — ML-based lead prioritization
- Einstein Opportunity Scoring — Win probability prediction
- Einstein Activity Capture — Auto-log emails and events
- Einstein Bots — Conversational AI for Service
- Einstein Prediction Builder — Custom predictions (no code)
- Einstein Next Best Action — Recommendations engine
- Einstein GPT / Copilot — Generative AI for CRM
Industry Clouds:
- Health Cloud — Patient management, care plans, health timelines
- Financial Services Cloud — Wealth management, banking
- Manufacturing Cloud — Sales agreements, account forecasting
- Education Cloud — Admissions, student success
- Nonprofit Cloud — Fundraising, program management
Developer impact: Understanding these clouds helps architects make technology decisions:
- Does the requirement call for a standard cloud feature or custom development?
- Which cloud combinations solve the business need?
- How do clouds interact in a multi-cloud org?
💻 Code Example
1// Experience Cloud & Analytics Development23// 1. Experience Cloud — Guest User handling4public without sharing class GuestUserService {56 // Methods for guest (unauthenticated) users need 'without sharing'7 // because guest users have minimal permissions89 @AuraEnabled10 public static Case submitSupportCase(11 String name, String email, String subject, String description12 ) {13 // Create case from portal14 Case newCase = new Case(15 Subject = subject,16 Description = description,17 SuppliedName = name,18 SuppliedEmail = email,19 Status = 'New',20 Origin = 'Portal',21 RecordTypeId = getRecordTypeId('Case', 'Portal_Case')22 );23 insert newCase;24 return newCase;25 }2627 @AuraEnabled(cacheable=true)28 public static List<Knowledge__kav> searchKnowledge(String searchTerm) {29 if (String.isBlank(searchTerm) || searchTerm.length() < 3) {30 return new List<Knowledge__kav>();31 }3233 String search = '%' + searchTerm + '%';34 return [35 SELECT Id, Title, Summary, UrlName, ArticleNumber36 FROM Knowledge__kav37 WHERE PublishStatus = 'Online'38 AND Language = 'en_US'39 AND (Title LIKE :search OR Summary LIKE :search)40 LIMIT 1041 ];42 }4344 private static Id getRecordTypeId(String obj, String devName) {45 return Schema.getGlobalDescribe().get(obj)46 .getDescribe().getRecordTypeInfosByDeveloperName()47 .get(devName).getRecordTypeId();48 }49}5051// 2. Einstein Prediction — Custom predictions via API52public class EinsteinPredictionService {5354 // Call Einstein Prediction Builder predictions55 @AuraEnabled56 public static Decimal getChurnProbability(Id accountId) {57 // Einstein Prediction Builder creates fields on the object58 Account acc = [59 SELECT Id, Name, Churn_Prediction__c, Churn_Score__c60 FROM Account WHERE Id = :accountId61 ];6263 return acc.Churn_Score__c; // 0-100 probability64 }6566 // Einstein Next Best Action67 @AuraEnabled(cacheable=true)68 public static List<Map<String, String>> getRecommendations(Id recordId) {69 // Recommendations are configured declaratively70 // Access programmatically via ConnectApi7172 // Simplified example73 List<Map<String, String>> recommendations = new List<Map<String, String>>();7475 Account acc = [76 SELECT Industry, AnnualRevenue, Last_Contact_Date__c77 FROM Account WHERE Id = :recordId78 ];7980 if (acc.Last_Contact_Date__c < Date.today().addDays(-90)) {81 recommendations.add(new Map<String, String>{82 'action' => 'Schedule Check-in',83 'reason' => 'No contact in 90+ days',84 'priority' => 'High'85 });86 }8788 if (acc.AnnualRevenue > 1000000 && acc.Industry == 'Technology') {89 recommendations.add(new Map<String, String>{90 'action' => 'Offer Enterprise Package',91 'reason' => 'High-value tech account',92 'priority' => 'Medium'93 });94 }9596 return recommendations;97 }98}99100// 3. CRM Analytics — SAQL query example101// SAQL (Salesforce Analytics Query Language)102// Used in CRM Analytics (Tableau CRM) dashboards103//104// q = load "Opportunities";105// q = filter q by 'StageName' in ["Closed Won", "Negotiation"];106// q = group q by 'Account.Industry';107// q = foreach q generate 'Account.Industry' as 'Industry',108// sum('Amount') as 'Total_Revenue',109// count() as 'Deal_Count',110// avg('Amount') as 'Avg_Deal_Size';111// q = order q by 'Total_Revenue' desc;112// q = limit q 20;
🏋️ Practice Exercise
Salesforce Clouds Practice:
- Build a customer portal using Experience Cloud with case submission and knowledge search
- Create a partner portal with deal registration and lead sharing
- Set up Einstein Lead Scoring and analyze the scoring model
- Build a CRM Analytics dashboard showing sales performance metrics
- Create an Einstein Bot for common support questions
- Configure Einstein Next Best Action recommendations for sales
- Build a custom Experience Cloud page with LWC components
- Set up Einstein Discovery to find patterns in your Opportunity data
- Create a multi-cloud solution combining Sales, Service, and Experience Cloud
- Design an architecture for an industry cloud (Healthcare or Financial Services)
⚠️ Common Mistakes
Not understanding guest user security in Experience Cloud — guest users bypass many security controls. Always use 'without sharing' deliberately and validate inputs
Over-customizing when standard cloud features exist — check if Einstein, Flow, or standard features solve the problem before writing Apex
Not considering license costs — each cloud has licensing implications. Architecture decisions must consider license models
Building custom AI when Einstein features exist — Einstein Prediction Builder, Lead Scoring, and Next Best Action cover many ML use cases without custom code
Ignoring mobile in Experience Cloud — portals must be responsive. Test on mobile devices early
💼 Interview Questions
🎤 Mock Interview
Mock interview is powered by AI for Experience Cloud, Analytics & AI. Login to unlock this feature.