---
schema_version: "1"
id: e52687a1cf406998896143eff636d9d51fc9ffb1f3311b498ac2aba7ac6120b2
title: Create a Prompt for Inventory Deviations in Consumer Goods
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/cg_task_admin_create_inventory_deviation_prompt.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_create_inventory_deviation_prompt.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 4dc2b8b8ac095e78029212d772265d5207c1534af76e5c03ecdabcd1862de6f5
description: With the prompt template, create a prompt that shows the inventory deviations for an account. You can customize the prompt to show a summary, analytics, or both. You must activate the prompt that generates the inventory deviations on the Warehouse page.
products:
  - Consumer Goods
release: "264"
---
# Create a Prompt for Inventory Deviations in Consumer Goods

With the prompt template, create a prompt that shows the inventory deviations for an account. You can customize the prompt to show a summary, analytics, or both. You must activate the prompt that generates the inventory deviations on the Warehouse page.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong> and <strong>Unlimited</strong> Editions with Consider Goods Cloud, Agentforce for Consumer Goods and the <a href="https://help.salesforce.com/s/articleView?id=ind.cg_licenses_embeddedai.htm&amp;release=264.0.0&amp;type=5" title="To prepare your Salesforce org for the generative AI capabilities available in Consumer Goods Cloud, make sure you have the required licenses for your Salesforce org.">required add-ons</a>.</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d97210e73">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d97210e73 ">To create and manage prompt templates in Prompt Builder:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d97210e73 ">Prompt Template Manager</td>

          </tr>
        </tbody>
      </table>

Turn on Einstein generative AI in Setup. See [Set Up Einstein Generative AI](https://help.salesforce.com/s/articleView?id=ai.generative_ai_enable.htm&type=5&language=en_US).

Turn on Einstein generative AI in Retail Execution Settings from Setup. See [Enable Einstein Generative AI in Consumer Goods Cloud](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_org_pref_embedded_ai.htm&release=264.0.0&type=5 "Before you get started with generative AI, enable Einstein in Consumer Goods Cloud from the Setup page.").

To create an inventory deviations prompt:

1. In Setup, find and select **Einstein Generative AI**.
2. Select **Prompt Builder**, and then select **New Prompt Template**.
3. Select **Record Summary** as the prompt template type.
4. Enter the template name and description.
5. Select **Warehouse** as the object.
6. Select **Next**.
7. In the Prompt Template Workspace section,
    1. Add a description to provide account summarization, analytics, or both.
    2. Select the resource as **Apex**.
    3. In the prompt description, select the `GenAIWarehouseInventoryDeviations` invocable actions.
8. We recommend to select Model Type as **Standard** and Models as **OpenAI GPT4 Omni Mini** as in the Template Properties section.
9. Select a warehouse for the Related Record lookup field.
10. Select **Save & Preview**.
    
    In the Resolution section, you can view the data fetched by the Apex classes, and in the Response section, you can view the response from the LLM.
11. Click **Activate**.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-consumer_goods_retail_admin-264-0-0-production-enus/5bb7d7f5-119d-42d0-8596-95e762837019/images/icon_example.png)

Example

Prompt Description

```
As a CRM assistant, your goal is to create a comprehensive inventory reconciliation summary tailored for a Direct Store Delivery (DSD) Supervisor at a consumer goods company. The DSD Supervisor oversees a team of drivers and co-drivers and has the following goals:

- Ensuring Product Quality and Safety: Verifying that products are loaded securely and in a manner that maintains product quality and safety standards during transportation.
- Monitoring Loading Procedures: Supervising loading procedures to ensure adherence to company protocols and standards, particularly focusing on correct handling and documentation of loaded products.
- Minimizing Inventory Deviations: Implementing measures to reduce discrepancies between expected and actual product quantities loaded onto trucks, and promptly addressing any deviations encountered.
- Tracking Loading Performance: Monitoring loading performance metrics such as loading times, accuracy of product counts, and adherence to loading schedules to optimize operational efficiency.

Inventory reconciliation summary should be based on the below csv details of the tour:
{!$Apex:cgcloud__GenAIWarehouseInventoryDeviations.Prompt}

Generate the output with the keys: ['product categories with highest discrepancies', 'root causes for inventory discrepancies',  ' driver performance', 'other useful insights', 'Follow-Up Action']

Inventory reconciliation summary should focus on: 
- Providing an inventory reconciliation report that consolidates data from various tours conducted from the warehouse.
- Analyzing deviations in product inventory during the loading process at the warehouse, specifically identifying discrepancies between expected and actual quantities of items documented for truckloads, along with reasons for these discrepancies.
- Understanding the primary causes behind inventory deviations occurring at the warehouse, prioritizing insights into these issues for better operational management.
- Evaluating driver performance based on the metrics such as minimum product damage at the time of loading.

Please include the following :
- Other useful insight: Deep insights on driver performance such as most common reason for a tour conducted by a particular driver could be different from the most prominent reason overall for the warehouse.
- Identify which product categories or types consistently show the highest discrepancies between expected and actual quantities during inventory reconciliation.
- Other useful insight:: Determine if there are specific times of day, days of the week, or seasonal patterns when inventory discrepancies are more likely to occur.
- Identify the most common reasons or root causes for inventory discrepancies, such as loading errors, documentation issues, or product damage during transit.
Rules:
Format of the summary should be in bullet points.
```

#### See Also

- [Salesforce Help: Prompt Builder](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_about.htm&type=5&language=en_US)