Setting Up Staging Sandbox for Experience Builder¶
This guide walks through setting up a staging sandbox to match your production Experience Cloud site configuration, including Activity Group pages and Managed Content folders.
🎯 Overview¶
When setting up a new sandbox, you may encounter errors in Experience Builder such as:
- "The Managed Content Folder Definition, Activity_Groups, is not valid."
- "We can't load the
component because it's not supported by any data."
This guide helps you resolve these issues by setting up the necessary components and data.
📋 Prerequisites¶
- Access to your staging sandbox
- System Administrator permissions
- Experience Cloud site already created (or cloned from production)
🔧 Step 1: Create Activity Group Chatter Groups¶
The EventChatterPostHelper requires Chatter groups with names matching your activity groups. Create these manually in Salesforce.
Required Activity Groups¶
Create public Chatter groups for:
- Hiking
- Climbing
- Backpacking
- Skiing
- Mountaineering
- Cycling
Plus any additional activity groups used in your Event_Registration__c records.
Creating Groups Manually¶
- Navigate to Chatter → Groups
- Click New Group
- Enter the activity group name (e.g., "Hiking")
- Set Access Type to Public
- Click Save
- Repeat for each activity group
Verify Groups Were Created¶
- Navigate to Chatter in your org
- Click Groups in the left sidebar
- Verify each activity group appears as a public Chatter group
⚠ Troubleshooting: Flow Error When Creating Groups¶
If you see errors like:
"We can't save this record because the 'Add Chatter Service To New Groups' process failed"
"INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY"
This means the "Add Chatter Service To New Groups" flow is trying to automatically add the service account (sm-client@prolocity.com) to new groups, but it's failing because:
- The service account doesn't exist in staging, OR
- The service account exists but isn't a member of the Experience Cloud site (for site-specific groups)
Solution Options¶
Option 1: Ensure Service Account Exists (Recommended)
- Verify the user
sm-client@prolocity.comexists and is active in your staging org - Add the user to your Experience Cloud site (if groups are site-specific)
- Use
scripts/apex/add_sm_client_to_all_chatter_groups.apexto add the user to existing groups
Option 2: Temporarily Deactivate the Flow
- Go to Setup → Flows
- Find "Add Chatter Service To New Groups"
- Click Deactivate
- Create the groups manually
- After groups are created, reactivate the flow
📁 Step 2: Create Managed Content Folder¶
Managed Content folders are created through the Experience Builder UI and cannot be deployed via metadata.
Manual Creation Steps¶
- Navigate to Setup → Digital Experiences → All Sites
- Click Builder next to your Experience Cloud site
- In Experience Builder, click the Settings gear icon (top right)
- Select Content from the settings menu
- Click New Folder or Manage Folders
- Create a new folder with:
- Name:
Activity_Groups - Type: Managed Content Folder
- Name:
- Save the folder
Alternative: Check Production Setup¶
If you have access to production, you can:
- Navigate to the same location in production
- Note the exact folder name and configuration
- Replicate it in staging
📊 Step 3: Create Test Data¶
Experience Builder components need data to display. Create test events for each activity group.
Using the Script¶
- Open Developer Console in your staging sandbox
- Go to Debug → Open Execute Anonymous Window
- Copy and paste the contents of
scripts/apex/create_test_events_by_activity_group.apex - Check Open Log and click Execute
- Review the debug logs to confirm events were created
What This Creates¶
- At least 3 approved events per activity group
- Events scheduled 7+ days in the future
- Events with
Chatter_Posted__c = false(ready for batch processing)
Verify Events Were Created¶
- Navigate to Event Registration tab (or object)
- Filter by
Status__c = 'Approved' - Group by
Activity_Group__cto see events per group
🧩 Step 4: Verify Experience Builder Pages¶
After setting up the above, verify your Experience Builder pages load correctly.
Check Activity Group Pages¶
- Navigate to Digital Experiences → All Sites → Builder
- Try navigating to each Activity Group page (e.g., "Climbing", "Hiking")
- Verify no errors appear
- Check that components display data correctly
Common Issues and Fixes¶
| Error | Cause | Solution |
|---|---|---|
| "Managed Content Folder Definition not valid" | Folder doesn't exist | Create the folder in Step 2 |
| "Component not supported by any data" | No records match component filters | Create test data in Step 3 |
| "Chatter group not found" | Chatter groups missing | Run script in Step 1 |
🔄 Step 5: Deploy Metadata (Optional)¶
If you need to deploy custom components, classes, or other metadata:
# Deploy to staging
sf project deploy start --target-org staging
Or use the Salesforce CLI to deploy specific components.
✅ Verification Checklist¶
- Chatter groups created for all activity groups
- Managed Content folder "Activity_Groups" exists
- Test events created for each activity group
- Experience Builder pages load without errors
- Components display data correctly
- Navigation works between activity group pages
🐛 Troubleshooting¶
Components Still Show "No Data" Error¶
- Check component filters: Verify the component's SOQL/record filters match your test data
- Check field values: Ensure required fields are populated on test records
- Check permissions: Verify your user profile has access to the objects/fields
Managed Content Folder Still Not Found¶
- Verify exact name: Check for typos - it must match exactly (case-sensitive)
- Check folder type: Must be "Managed Content Folder", not "Content Folder"
- Refresh Experience Builder: Close and reopen the builder after creating the folder
Chatter Groups Not Found by EventChatterPostHelper¶
- Verify group names: Group names must exactly match
Activity_Group__cfield values - Check group type: Groups should be "Public" for visibility
- Check permissions: Ensure the running user has access to the groups
Flow Preventing Group Creation¶
If groups fail to create due to the "Add Chatter Service To New Groups" flow:
- Check if service account exists: Query
SELECT Id, Username FROM User WHERE Username = 'sm-client@prolocity.com' - Verify the service account is active and has proper permissions, OR
- Temporarily deactivate the flow (Setup → Flows → "Add Chatter Service To New Groups" → Deactivate)
📚 Related Documentation¶
💡 Tips¶
- Keep staging in sync: Regularly refresh test data to match production patterns
- Document customizations: Note any manual UI configurations that can't be deployed
- Test thoroughly: Verify all activity group pages work before deploying to production
✨ Need help? Check the debug logs from the scripts for detailed information about what was created or any errors encountered.