---
schema_version: "1"
id: 8ad1ff1e488c2290b613c69cf32bdf4be593727091519527473036415c9fc65c
title: Revenue | Query Contract Document
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ai/264-0-0/agent_ref_revenue_query_contract_document.md
canonical_url: https://help.salesforce.com/s/articleView?id=ai.agent_ref_revenue_query_contract_document.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 40d2c9341ae52d201e7aa883bc4d04041cbfc4871026c2e556f572d8f789d775
description: Finds and retrieves relevant information from a contract document based on the user's question. Answers questions related to contract documents, including terms, obligations, and clauses.
products:
  - Agentforce
  - Cross Cloud
release: "264"
---
# Revenue | Query Contract Document

Finds and retrieves relevant information from a contract document based on the user's question. Answers questions related to contract documents, including terms, obligations, and clauses.

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

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
      <colgroup>
        <col>
        <col>
      </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="d136009e70">User Permissions
            Needed</th>
        </tr>
      </thead>
      <tbody>
        <tr class="">
          <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d136009e70 ">To run this action:</td>

          <td class="slds-cell-wrap" style="vertical-align:top;" headers="d136009e70 ">
            <p>Data Cloud Admin</p>
            <p> AND </p>
            <p>CLM Admin User</p>
            <p> AND </p>
            <p style="margin-bottom:0;">Contracts AI
              User</p>
          </td>

        </tr>
        <tr class="">
          <td class="slds-cell-wrap" colspan="2" style="vertical-align:top;" headers="d136009e70 ">See <a href="https://help.salesforce.com/s/articleView?id=ai.agent_actions_common_perms.htm&amp;type=5&amp;language=en_US" target="_blank">Common User Access for Standard Agent
              Actions</a>.</td>

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

## Action Details

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small "><colgroup><col style="width:50%"> <col style="width:50%"></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">API Name</td><td class="slds-cell-wrap" style="vertical-align:top;">QueryContractDocument</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Reference Action Type</td><td class="slds-cell-wrap" style="vertical-align:top;">Prompt Template</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Reference Action</td><td class="slds-cell-wrap" style="vertical-align:top;">clm_ai__AnswerWithContractDocument</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Does this action execute one or more prompt templates?</td><td class="slds-cell-wrap" style="vertical-align:top;">Yes</td></tr></tbody></table>

## Query Contract Document and Prompt Template

The Query Contract Document agent action uses Contract Q&A prompt template to answer questions about contract document content. The action uses the contract document currently in focus to process and return relevant information.

The action passes two required, non-editable inputs to the chosen template:

- Query – the user’s question.
- Contract ID – the ID of the contract record to analyze.
- Chunk Limit - the limit of the maximum number of chunks to be retrieved based on user query

Customization options: You can modify your prompt template instructions to create a new custom version and activate it to customize the template. See [Customize Prompt Template for Contract Search](https://help.salesforce.com/s/articleView?id=ind.sf_contracts_customize_prompt_template_for_contract_search.htm&type=5&language=en_US).

## Chain Actions Together

You can combine Query Contract Document action with [Draft or Revise Email](https://help.salesforce.com/s/articleView?id=ai.copilot_actions_ref_draft_or_revise_email.htm&language=en_US&type=5) action to streamline how users extract contract insights and communicate them. For instance, an AI agent can help a user locate terms and immediately turn that into an email for internal or external stakeholders. Users can either include both actions in a single instruction or run them in sequence.

Single Request:

I need to search and obtain contract records for Ursa Major Solar. They deal with the supply of paper packaging materials and are based in New Delhi, India. They're facing issues due to a paper shortage from their supplier, Cloud Kicks in China. Can you fetch the relevant contracts?

Multiple Requests:

Rep: What exactly does the delivery of paper packaging materials entail? Are there specifications or quality standards to adhere to for delivery?

Agent: Scope of Services: Cloud Kicks is obligated to deliver paper packaging materials as per the terms of the agreement. Specific quality standards or material details are not mentioned, so these might need further clarification outside the contract. Delivery Timeline: Deliveries must be completed within three (3) days from the date of the agreement, subject to the conditions stated in the contract.

Rep: What is the payment structure and method listed in the document -

Agent: The total price for the delivery services is $1 million. Ursa Major Solar must make payment within thirty (30) days of receiving the invoice.

Rep: What if Cloud Kicks fails to deliver in time and what is the mitigation for that?

Agent: Force Majeure Impact: Both parties are excused from obligations if events beyond their control, such as severe weather, terrorism, or acts of God, prevent performance. The affected party must notify the other party promptly and provide an estimate of the delay's duration. Mitigating Delays: If a delay occurs due to force majeure, Cloud Kicks must take all reasonable measures to minimize the impact on delivery.

Rep: What happens if Ursa Major Solar decides to file a litigation in case of any disputes due to failure of delivery?

Agent: The agreement is governed by the laws of Texas, USA, which may influence interpretation and enforcement in legal disputes.

Rep: Can you please compile and send all the details that we discussed above and send it to the legal attorney assigned for this account?

Agent: Sure, let me show you the preview and then we can send it.

## Guidelines and Considerations

Before using this action, make sure you’ve completed the Contract Search setup and understand any constraints. See [Configure Contract Search](https://help.salesforce.com/s/articleView?id=ind.sf_contracts_set_up_contract_search_for_contract_ai.htm&type=5&language=en_US) and [Contract Search Limitations](https://help.salesforce.com/s/articleView?id=ind.sf_contracts_contract_search_limitations.htm&type=5&language=en_US).