---
schema_version: "1"
id: 5324bd535e04c5ad42c9189ae30398795c849ecb5a8f628964e708c8171198e3
title: Grounding with File Inputs
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ai/264-0-0/prompt_builder_ground_file.md
canonical_url: https://help.salesforce.com/s/articleView?id=ai.prompt_builder_ground_file.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: f1c9cb007d9c16c697423c3f3d315f96e97a090bbb63af7ee0cb6e5fbf336dfe
description: Ground generative AI prompt templates with files so the AI model can use documents, spreadsheets, presentations, images, and email text in the resolved prompt.
products:
  - Agentforce
  - Cross Cloud
release: "264"
---
# Grounding with File Inputs

Ground generative AI prompt templates with files so the AI model can use documents, spreadsheets, presentations, images, and email text in the resolved prompt.

### 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>, <strong>Performance</strong>, and <strong>Unlimited</strong> Editions with the Einstein for Platform, or Einstein or Agentforce for Sales or Service add-on, or Agentforce Foundations</td></tr></tbody></table>

With file inputs, you ground a prompt template with richer context than record fields alone. Add PDFs, images, Microsoft Office files, text files, CSV files, and email files so the AI model can process contracts, product sheets, presentations, and text at run time.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ai-generative_ai-264-0-0-production-enus/f8ef6498-d7b2-44e3-9b34-ffd5a850aae9/images/icon_note.png)

Note Not every AI model accepts file inputs. Before you add files, review **Details** for the selected AI model. Unsupported files are excluded from the request. Excluded files are listed in the Resolution panel after processing.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
      <colgroup>
        <col style="width:42.857142857142854%">
        <col style="width:57.14285714285714%">
      </colgroup>
      <thead class="slds-text-title_caps ">
        <tr class="">
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d14004e76">How the file is sent</th>
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d14004e79">File Types</th>
        </tr>
      </thead>
      <tbody>
        <tr class="">
          <td data-label="How the file is sent" class="slds-cell-wrap" style="vertical-align:top;" headers="d14004e76 ">Sent as a file (no conversion)</td>

          <td data-label="File Types" class="slds-cell-wrap" style="vertical-align:top;" headers="d14004e79 ">
            <code>.pdf</code>, <code>.jpg</code>, <code>.jpeg</code>,
            <code>.png</code>
          </td>

        </tr>
        <tr class="">
          <td data-label="How the file is sent" class="slds-cell-wrap" style="vertical-align:top;" headers="d14004e76 ">Converted to PDF at run time, then sent as a file</td>

          <td data-label="File Types" class="slds-cell-wrap" style="vertical-align:top;" headers="d14004e79 ">
            <p>
              <code>.xls</code>, <code>.xlsx</code>,
              <code>.xltx</code>
            </p>
            <p>
              <code>.doc</code>, <code>.docx</code>
            </p>
            <p>
              <code>.ppt</code>, <code>.pptx</code>
            </p>
            <p>
              <code>.txt</code>
            </p>
            <p style="margin-bottom:0;">
              <code>.csv</code> (converted to text first, then to PDF)
            </p>
          </td>

        </tr>
        <tr class="">
          <td data-label="How the file is sent" class="slds-cell-wrap" style="vertical-align:top;" headers="d14004e76 ">Added as text in the prompt (not sent as a file)</td>

          <td data-label="File Types" class="slds-cell-wrap" style="vertical-align:top;" headers="d14004e79 ">
            <code>.eml</code>: The email body is extracted as plain text.
            Attachments and HTML formatting aren’t included.
          </td>

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

After you select a file, the file and its metadata are associated with the prompt template. Files are stored as Salesforce Files. To use file metadata in the prompt template, click **Resources** and insert a merge field.

## How Conversion and Exclusions Work

Conversion runs at run time, not when you upload the file in **Preview**. Each file converts one at a time. If conversion fails, then that file is excluded and a warning appears.

After processing, the Resolution panel can show:

- **PDF Conversion Completed**: The file was converted to PDF so the AI model can process it.
- **Email Text Extraction Completed**: Email text was added to the prompt. Attachments and formatting weren’t included.

Warning messages appear when conversion fails, a file exceeds a limit, conversion times out, or the AI model doesn’t support the file type.

Converted files appear in the resolved prompt with a PDF icon. Open the icon to view the original file.

Open **Details** for the selected AI model to see file-type limits and how each type is sent.

## Einstein Trust Layer

At run time, JPEG, PNG, and PDF files are sent as files. Files that convert to PDF are also sent as PDF files. The Einstein Trust Layer doesn’t apply protections to the contents of those files. To apply protections in the Einstein Trust Layer to a PDF, extract the PDF content as text into the prompt template, and then send the prompt to the AI model.

Prompt Builder adds only extracted plain text from `.eml` files. The Einstein Trust Layer applies data masking to that extracted text.

#### See Also

- [Add File Inputs to a Flex Prompt Template](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_add_file_flex.htm&release=264.0.0&type=5 "Create a flex prompt template that includes file inputs.")
- [Add a Related List with File Inputs to a Flex Prompt Template](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_add_related_lists_file_flex.htm&release=264.0.0&type=5 "Create a flex prompt template that includes a related list with file inputs.")
- [Prompt Builder Limits](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_limits.htm&release=264.0.0&type=5 "Learn the numerical limits of prompt templates.")