Welcome to the DIY Storefront, a sample retail application. DIY Storefront is a fictional retail store that uses Data 360, Agentforce, and the Salesforce Platform to deliver highly personalized customer experiences.
The DIY Storefront app showcases Data 360, Agents, and Prompts by using both structured and unstructured data, including Intelligent Context, to process complex information.
There are 3 required steps, these steps allow you to setup Data 360, import data (both structured and unstructured), and setup the employee agent within your Salesforce instance. After completing the first three steps, if you want to install the agent in your own website use Step 4, and if you want to install the agent on an Experience Cloud site follow step 5. Steps 4 & 5 are optional.
To support the DIY app, you can either create a new Salesforce Org or use an existing one, provided it includes the following features and licenses:
| Requirement | Details |
|---|---|
| Licenses Required | - Data Cloud - Sales Cloud - Service Cloud |
| Features Required | - Service Agent - Einstein Agent - Copilot - Prompt Builder - Agentforce Data Library - Agentforce Studio - Process Content - Intelligent Context |
[!IMPORTANT] It is recommended to start with a brand-new environment to avoid conflicts with any previous work you may have done. A developer org can also be used.
- Install VSCode Download
- Install the Salesforce CLI or Verify that your installed CLI version is greater than
2.56.7by runningsf -vin a terminal. - Open VS Code > Go To> Extensions->Search for Salesforce Extension Pack>Click Install
- Install Git(Ignore if already installed) Git
- Open VS Code > Go To Extensions->Search for Git Extension Pack>Click Install
-
Clone this repository:
git clone https://git.soma.salesforce.com/gdevadoss/Data360RetailSolutionKit.git
-
Authorize your org with the Salesforce CLI.
- Ctrl+Shift+P Select SFDX:Authorize an Org -> Select Project Default -> Enter the Org alias -> Authorize the Org.
-
Deploy the base app metadata.
sf project deploy start -d diy-base
-
Assign Base Permission Set to Default User.
sf org assign permset -n DIYRetailBasePS
-
Activate Standard PriceBook.
sf apex run -f scripts/apex/activatePricebook.apex
-
Replace the Standard Price Book variable in the JSON file with the actual Standard PricebookId by following the steps below in order. *Choose PowerShell in VS code Terminal
$pbQuery = sf data query -q "SELECT Id FROM Pricebook2 WHERE IsStandard = true AND IsActive = true LIMIT 1" --json | ConvertFrom-Json
$STD_PB_ID = $pbQuery.result.records[0].Id
Write-Output "Standard Price Book Id: $STD_PB_ID"(Get-Content data\pricebookentries.json) -replace "STANDARD_PRICEBOOK_ID", $STD_PB_ID | Set-Content data\pricebookentries.json
-
Import Sample data.
sf data tree import -p data/plan.json
-
Adjust Order Effective Date.
sf apex run -f scripts/apex/updateEffectiveDatesonOrder.apex
-
Activate Orders Data Using Anonymous Apex.
sf apex run -f scripts/apex/activateOrderStatus.apex
| Step | Action and Details | Image |
|---|---|---|
| Navigate to Documents folder in GitHub Repository | - Open a web browser and go to GitHub. - Once inside the repository, you will see the DIY Documents at the root level. - Click on a folder name to open it and view its contents. - Click on Customer Affinities to open the file - Click on Download to save in your system Note: Follow the above procedure to download the following documents: POS, Website, Customer Engagements, Bathroom_Remodelling_Instructions, Building Deck, and DIY Seasonal.Ensure that all files are securely saved to your local system, as they will be required for subsequent processing and configuration steps. |
| Step | Action and Details | Images |
|---|---|---|
| Enable Commerce Cloud | - From Setup, enter Commerce in the Quick Find box. - Select Settings under Commerce. - Turn on Enable Commerce. |
![]() |
| Create a Basic Experience Builder Site | - From Setup, enter Digital Experiences in the Quick Find box. - Select All Sites under Digital Experiences. - Click New to open the Creation wizard with template options. - Select the Commerce Store (LWR) template. - Click Get Started. - Provide Store Name as ‘DIYStorefront’ and ensure the URL ends with /DIYStorefront - Click Create. Your site will be created in Preview status. |
![]() ![]() |
| Activate Site | - From Setup, enter Digital Experiences and select All Sites under Digital Experiences. - Click Workspaces next to DIYStorefront. - Select Administration. - In Settings, click Activate and confirm by clicking OK. - Your site will now be live and fully set up. |
![]() |
| Register Site Setting | - Go to Domains from Setup under User Interface and copy the Experience Cloud Sites Domain. - Open the ESW Web Deployment site. - Under Trusted Domains for Inline Frames, click New. - Paste the copied domain URL and click Save. |
![]() |
| Digital Experience | - From Setup, search for Digital Experiences and select Settings. - Enable Allow using standard external profiles for self-registration, user creation, and login. - Click OK in the dialog box. |
![]() |
| Experience Cloud Automated Setup | - Deploy Experience cloud packagesf project deploy start -d diy-pd-experience-optional- Create Experience Site User sf apex run -f scripts/apex/createSiteUser.apex |
|
| CORS Configuration | - From Setup, search for CORS and click New. - Add https://*.my.salesforce-scrt.com and Save. - From Setup, search for and select Domains under User Interface. - Copy the My Domain URL and the Experience Cloud Sites Domain. - Add both URLs separately in CORS and click Save. -Click New and Add https://d2rn326tyl2v2c.cloudfront.net. -click save |
![]() ![]() |
| Trusted URL | - Go to Domains under User Interface and copy the Experience Cloud Sites Domain. - From Setup, search for Trusted URLs and click New Trusted URL. - Enter the Name as DIYStore and paste the copied domain URL, ensuring it starts with https://. - Make Sure to select all the CSP directives. -Click Save. -Click New Trusted Domain and Enter the Name as CloudFrontImages and the URL as https://d2rn326tyl2v2c.cloudfront.net. -Make sute select all the CSP directives and click save |
![]() |
| Step | Action and Details | Images |
|---|---|---|
| Enable Search Index | - Click on App Launcher, Search and Select Commerce application. - Scroll down to Setting and expand it - Click on Search - Use the toggle to turn on Automatic Updates. |
![image]https://github.com/salesforce-misc/Data360AgentforceSolutionKitRetail/blob/main/Commerce%20Cloud/SearchIndexCMStart.png) |
| Enable Guest access | - Click on the App Launcher, search for and select the Commerce application and select DiyStoreFront. - On the left-hand side, click Stores under Settings. - Go to Buyer Access Tab. - Navigate to the Buyer Access tab. - Scroll down to the Guest Access section. - Click on Enable button and click on Continue. |
![]() |
| Assign Guest User to Buyer Group | - In the DiyStoreFront store, On the left-hand side, click Stores under Settings. - Click on Buyer Access Tab - Click on DIYStorefront Guest Buyer Profile under Guest Access . - Click on Related ->Click on Buyer Groups , Click on Assign Button -Select the checkbox for DIYStorefront Buyer Group and click on Assign Button |
![]() |
| Assign Customer User to Buyer Group | - Go to the App Launcher, search for Accounts, and open it. - Open the Mark Smith account and click Enable as Buyer. - In DIYStoreFront, navigate to Settings > Buyer Access. - Open the DIYStorefront Buyer Group. - Under Buyer Group Members, click Assign, search for Mark Smith, and click Save. |
![]() ![]() ![]() |
| Execute Commerce Script | - Create Commerce Data:sf apex run -f scripts/apex/createCommerceData.apex - Create Store Pricebook: sf apex run -f scripts/apex/storePricebookCreation.apex |
|
| Create CMS Workspace | - Click on the App Launcher >> Select the Commerce application >> Click on Stores. - Open DIYStorefront Store - Scroll down to Content Manager - Click on Add workspace - Enter details such as Name "DIYStoreFront CMS". - click on Next - Add DIYStoreFrontChannel & DIYStoreFront. - Click Next - Keep language as it is and click on Finish |
![]() ![]() |
| Adding Images into CMS | - Download Images from CMS Images - Click on the App Launcher >> Select the Commerce application >> Select DIYStorefront Store - Scroll down to Content Manager - Open DIYStoreFront CMS - click on Add >>Select Content >>Select Image and click on Create button. - Click Upload and select the downloaded images from local and click Done. - Copy the Title and paste the value in API Name field. - Click Save >>click Publish and click on Next and Click on Publish Now. - Follow the above steps for the remaining images |
![]() |
| Link Image to a Product | - Click the App Launcher. - Select the Commerce application. - Open Stores and select DIYStorefront. - Navigate to Merchandise > Products and open the required product. - Scroll down to the Media section. - Click Add and select Add Image from Library. - Choose the appropriate image and click Save. |
![]() ![]() |
| Publish Website Design | - Click on the App Launcher. - Select the Commerce application. - Go to Stores and select DIYStoreFront. - Scroll down to Website Design. - From the dropdown, select Product, Category, then click Publish (this step may not be required if you are using the Commerce Console). - Go back to the DIYStoreFront store. - Click Home, then click Preview to verify that the products are displayed on the site. |
![]() ![]() |
| Update Search Index | - From Commerce App Go to Setting >> Search. - Under Search Index Tab >> Click on Update Button on the top Right corner. - Select Full Update. - Wait until the update completes to see the product in ExperienceSite. |
![]() ![]() |
| Step | Action and Details | Images |
|---|---|---|
| Enable Messaging Channel | - Navigate to Setup go to messaging setting. - Toggle on the messaging. |
![]() |
| Configure Site Setting | - In Setup, search for Sites and click Register My Salesforce Site Domain | ![image]https://github.com/salesforce-misc/Data360AgentforceSolutionKitRetail/blob/main/Experience%20Cloud/RegisterDomain.png) |
| Embedded Service Messaging Setup | - Install Embedded Service Package:sf project deploy start -d diy-embeddedservice.- Activate Messaging Channel: sf apex run -f scripts/apex/activateMessagingChannel.apex -Whitelist the External Website for Inline Frame Access: -Open the Embedded Service Deployment and locate the Site Endpoint that starts with ESW (ESA Web Deployment). - Click the endpoint link to open the site settings. - Under Trusted Domains for Inline Frames, click Add Domain. - Enter the same experience site url. - Click Save. |
![]() |
| Publish ESA | - Click on Setup - In Quick Find, Search and Select Embedded Service Deployments. - Click on ESA Web Deployment - Click on 'Publish' button - Wait for confirmation Message |
![]() |
| Create a New Version of Omni-Channel Flow | - Click on Setup - Search for Flows in the Quick Find box and select it. - Open the flow Route Conversations to Agentforce Service Agents. - Deactivate the flow and open theRoute to Service Agent element. - Refresh the Service Channel by selecting a different option and then reselect Live Messaging. - Set Route To as Agentforce Service Agent and choose DIY Assistant. - In Fallback Queue ID, remove the existing queue and reselect the same queue. - Click Save As New Version, then click Activate. |
![]() |
| Step | Action and Details | Image |
|---|---|---|
| Configure CORS Settings | - From Setup, search for CORS and , click New. - Enter the external website URL. Do not include a trailing “/”. - Click New and Add. https://*.my.salesforce-scrt.com - Click New and Add https://d2rn326tyl2v2c.cloudfront.net. |
![]() |
| Step | Action and Details | Image |
|---|---|---|
| Configure Trusted URL | - In Setup, search for Trusted URLs and select it, then click New Trusted Domain. -Enter the API Name and URL — use the same external site URL provided earlier. - Select frame-src (iframe content). - Click Save. - Click New Trusted Domain. -Enter the Name as CloudFrontImages and the URL as https://d2rn326tyl2v2c.cloudfront.net. - Select the required CSP Directives as shown in the screenshot, then click Save. |
![]() |
| Step | Action and Details | Image |
|---|---|---|
| Script for Executing Agent in External Site | - From Setup, search for Embedded Service Deployments. - Select ESA Web Deployment, scroll down, and click Install Code Snippet. - Copy the code snippet. |
That’s it! You’re all set. The Agentforce widget should now be visible on your external website.
Behind the Scenes - how is the agent powered?
Curious to see the all possible utterances and how they are powered by the Agent. Here is a list of all the possible conversations, the corresponding topics, and the components that power them. | Sl. No. | Utterance | Behind the Scene | Topic | Components |
|---|---|---|---|---|
| 1. | What is on sale right now? | Based on the structured data ingested into Data Cloud, we are fetching the promotional products and displaying them. | DIY Store Assistant | a) Apex ItemsOnSale |
| 2. | Do I need anything for seasonal prep? | An initial prompt evaluates the current weather data. Based on the evaluated conditions, a subsequent prompt dynamically fetches weather-specific product | DIY Store Assistant | a) Flow Seasonal Product Recommender b) Prompt Season Predictor Fetch Seasonal Products |
| 3. | How do I protect my plants over the winter? | Reads unstructured data from PDF that has been ingested into Data Cloud, where it is chunked, vectorized, and indexed for easy retrieval. | plant Seasonal Recomendation | a) Prompt Action seasonalPlantRecomendation |
| Sl. No. | Utterance | Behind the Scene | Topic | Components |
|---|---|---|---|---|
| 1. | I’m stopping by the store later — anything I should pick up? | Use LLM to analyze customer past purchase history about power tools and but does not have any storage products, and recommend suitable storage options used an prompt | Customer Purchase Order | a) Prompt Action combineRecomendationMethod b) Apex Class GenericProductService GenericProductInvocable |
| 2. | That storage cabinet looks huge. Not sure how I’d get it home | Reads unstructured data from PDF that has been ingested into Data Cloud, where it is chunked, vectorized, and indexed for easy retrieval. | Customer Purchase Order | a) Prompt Action storageCabinetDetails b)Retriever DIY_Bathroom Retriever |
| 3. | Do I need anything for seasonal prep? | An initial prompt evaluates the current weather data. Based on the evaluated conditions, a subsequent prompt dynamically fetches weather-specific product | DIY Store Assistant | a) Flow Seasonal Product Recommender b) Prompt Season Predictor Fetch Seasonal Products |
| 4. | What are the current sales that would interest me? | The system leverages structured data ingested into Data Cloud to analyze the customer’s historical purchase records. Any products that overlap with active promotions are filtered out, and only the remaining eligible promotional products are displayed. | DIY Store Assistant | a) Apex Generic Product Engine |
| 5. | My furnace has been acting up | The system uses structured Data Cloud data to verify installation and maintenance records. It evaluates whether the product has exceeded its warranty period and provides the corresponding warranty status (in-warranty or out-of-warranty). If requested, it also suggests an appropriate basic maintenance plan. | DIY Store Assistance | a) Apex HVACWarrantyService |
| 6. | I’m remodeling my bathroom — what do I need? | Reads unstructured data from PDF that has been ingested into Data Cloud, where it is chunked, vectorized, and indexed for easy retrieval. | DIY Projects | a) Prompt Action Bathroom Remodeling Prompt b)Retriever DIY_Bathroom Retriever |
| 7. | I bought composite decking — is my blade okay? | Use LLM to analyze customer past purchase history about blade product and provide information as blade product description and features | Blade Product | a) Prompt Action BladeProductRecomendation b) Flow Fetch Seasonal Products |
| 8. | I’m thinking about upgrading my tools. | Use LLM to analyze customer past purchase history about battery product and recommends environmentally friendly alternatives. | Customer Purchase Products | a) Prompt Action BatteryProductRecomendation b) Apex Class GenericProductService GenericProductInvocabler |
| 9. | Anything interesting on sale right now? | Structured data stored in Data Cloud is used to analyze the customer’s past purchase history and derive product categories. Based on the identified categories, relevant products are recommended. | DIY Store Assistant | a) Apex CurrentSalesRecommendation |
| Sl. No. | Utterance | Behind the Scene | Topic | Components |
|---|---|---|---|---|
| 1. | I’m stopping by the store later — anything I should pick up? | Customer purchase history is retrieved from structured Data Cloud datasets and analyzed to identify previously purchased product categories, such as power tools | DIY Store Assistant | a) Flow StorageProductEnquiry b) Apex storageProducts storageProductInvocable c) LightningType storageProducts |
| 2. | That storage cabinet looks huge. Not sure how I’d get it home | Reads unstructured data from PDF that has been ingested into Data Cloud, where it is chunked, vectorized, and indexed for easy retrieval. | Customer Purchase Products | a) Prompt Action storageCabinetDetails b) Retriever DIY_Bathroom Retriever |
| 3. | Do I need anything for seasonal prep? | An initial prompt evaluates the current weather data. Based on the evaluated conditions, a subsequent prompt dynamically fetches weather-specific product | DIY Store Assistant | a) Flow Seasonal Product Recommender b) Prompt Season Predictor Fetch Seasonal Products c) Apex seasonalProducts d) LightningType seasonalProducts |
| 4. | What are the current sales that would interest me? | The system leverages structured data ingested into Data Cloud to analyze the customer’s historical purchase records. Any products that overlap with active promotions are filtered out, and only the remaining eligible promotional products are displayed. | DIY Store Assistant | a) Flow PromotionEligibility b) Apex Get Promotion Details promotion c) LightningType promotion |
| 5. | My furnace has been acting up | The system uses structured Data Cloud data to verify installation and maintenance records. It evaluates whether the product has exceeded its warranty period and provides the corresponding warranty status (in-warranty or out-of-warranty). If requested, it also suggests an appropriate basic maintenance plan. | DIY Store Assistance | a) Apex HVACWarrantyService |
| 6. | I’m remodeling my bathroom — what do I need? | Reads unstructured data from PDF that has been ingested into Data Cloud, where it is chunked, vectorized, and indexed for easy retrieval. | DIY Projects | a) Prompt Action Bathroom Remodeling Prompt b) Retriever DIY_Bathroom Retriever |
| 7. | I bought composite decking — is my blade okay? | Uses LLM to analyze customer past purchase history about blade product and provide information as blade product description and features | Blade Product | a) Prompt Action BladeProductRecomendation |
| 8. | I’m thinking about upgrading my tools. | Customer past purchase history is retrieved from structured Data Cloud datasets to identify battery-related products. Based on predefined product attributes and sustainability classifications, environmentally friendly alternatives are recommended accordingly. | Customer Purchase Products | a) Flow UpgradingToolsSuggestion b) Apex storageProducts batteryProductRecomendationCls c) LightningType storageProducts |
| 9. | Anything interesting on sale right now? | Structured data stored in Data Cloud is used to analyze the customer’s past purchase history and derive product categories. Based on the identified categories, relevant products are recommended. | DIY Store Assistant | a) Flow SalesRecommendation b) Apex Current Sales Recommendations seasonalProducts c) LightningType seasonalProducts |
































































.png)


























.png)
