Experience Cloud, Analytics & AI

0/2 in this phase0/41 across the roadmap

📖 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

codeTap to expand ⛶
1// Experience Cloud & Analytics Development
2
3// 1. Experience Cloud — Guest User handling
4public without sharing class GuestUserService {
5
6 // Methods for guest (unauthenticated) users need 'without sharing'
7 // because guest users have minimal permissions
8
9 @AuraEnabled
10 public static Case submitSupportCase(
11 String name, String email, String subject, String description
12 ) {
13 // Create case from portal
14 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 }
26
27 @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 }
32
33 String search = '%' + searchTerm + '%';
34 return [
35 SELECT Id, Title, Summary, UrlName, ArticleNumber
36 FROM Knowledge__kav
37 WHERE PublishStatus = 'Online'
38 AND Language = 'en_US'
39 AND (Title LIKE :search OR Summary LIKE :search)
40 LIMIT 10
41 ];
42 }
43
44 private static Id getRecordTypeId(String obj, String devName) {
45 return Schema.getGlobalDescribe().get(obj)
46 .getDescribe().getRecordTypeInfosByDeveloperName()
47 .get(devName).getRecordTypeId();
48 }
49}
50
51// 2. Einstein Prediction — Custom predictions via API
52public class EinsteinPredictionService {
53
54 // Call Einstein Prediction Builder predictions
55 @AuraEnabled
56 public static Decimal getChurnProbability(Id accountId) {
57 // Einstein Prediction Builder creates fields on the object
58 Account acc = [
59 SELECT Id, Name, Churn_Prediction__c, Churn_Score__c
60 FROM Account WHERE Id = :accountId
61 ];
62
63 return acc.Churn_Score__c; // 0-100 probability
64 }
65
66 // Einstein Next Best Action
67 @AuraEnabled(cacheable=true)
68 public static List<Map<String, String>> getRecommendations(Id recordId) {
69 // Recommendations are configured declaratively
70 // Access programmatically via ConnectApi
71
72 // Simplified example
73 List<Map<String, String>> recommendations = new List<Map<String, String>>();
74
75 Account acc = [
76 SELECT Industry, AnnualRevenue, Last_Contact_Date__c
77 FROM Account WHERE Id = :recordId
78 ];
79
80 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 }
87
88 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 }
95
96 return recommendations;
97 }
98}
99
100// 3. CRM Analytics — SAQL query example
101// SAQL (Salesforce Analytics Query Language)
102// Used in CRM Analytics (Tableau CRM) dashboards
103//
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:

  1. Build a customer portal using Experience Cloud with case submission and knowledge search
  2. Create a partner portal with deal registration and lead sharing
  3. Set up Einstein Lead Scoring and analyze the scoring model
  4. Build a CRM Analytics dashboard showing sales performance metrics
  5. Create an Einstein Bot for common support questions
  6. Configure Einstein Next Best Action recommendations for sales
  7. Build a custom Experience Cloud page with LWC components
  8. Set up Einstein Discovery to find patterns in your Opportunity data
  9. Create a multi-cloud solution combining Sales, Service, and Experience Cloud
  10. 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.