---
schema_version: "1"
id: 75cce137877d26bcbe52c21b83e41a02a82306c25bd24d8ce0cef6e15f0831a4
title: Determine the Discount for Orders (Example)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/concept_decision_table_example.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.concept_decision_table_example.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 69ab7e111e2b8d84d3740ba6309c0b1f6f203adab7bde20fbf850f239b8fd5d3
description: This example shows how an admin can set up a decision table to automate order discount decision process.
products:
  - Industry Solutions
  - Cross Cloud
release: "264"
---
# Determine the Discount for Orders (Example)

This example shows how an admin can set up a decision table to automate order discount decision process.

### 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: Enterprise, Performance, and Unlimited Editions with Loyalty Management or Rebate Management</td></tr></tbody></table>

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-decision_table-264-0-0-production-enus/b36b081a-a35e-4748-bca9-059568605a0b/images/icon_note.png)

Note Decision tables are also available as part of Business Rules Engine. If your org has Business Rules Engine enabled, see [Decision Tables for Business Rules Engine](https://help.salesforce.com/s/articleView?id=ind.decision_tables.htm&type=5&language=en_US).

A company wants to provide discounts on orders based on the order quantity or the product purchased. The company uses the Order standard object in its Salesforce org to store all its orders. It uses the Product standard object to store all the products. The company adds two fields to the Order object based on its unique requirements: Order Quantity and Discount.

The company’s sales team gives the admin these rules to determine the discount percentage for orders.

<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>
      <thead class="slds-text-title_caps ">
        <tr class="">
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d3899e71">Discount</th>
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d3899e74">Rule</th>
        </tr>
      </thead>
      <tbody>
        <tr class="">
          <td data-label="Discount" class="slds-cell-wrap" style="vertical-align:top;" headers="d3899e71 ">5%</td>

          <td data-label="Rule" class="slds-cell-wrap" style="vertical-align:top;" headers="d3899e74 ">
            <p>Order Quantity: 20–49</p>
            <p>OR</p>
            <p style="margin-bottom:0;">Product: Running Shoes</p>
          </td>

        </tr>
        <tr class="">
          <td data-label="Discount" class="slds-cell-wrap" style="vertical-align:top;" headers="d3899e71 ">10%</td>

          <td data-label="Rule" class="slds-cell-wrap" style="vertical-align:top;" headers="d3899e74 ">
            <p>Order Quantity: 50–100</p>
            <p>OR</p>
            <p style="margin-bottom:0;">Product: Athletic Shorts</p>
          </td>

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

To set up and run the decision table, the admin:

- Creates a custom object that contains the discount rules.
- Creates a decision table that reads the discount rules.
- Creates a dataset link and maps the Order and Product object fields with the decision table’s input fields.
- Sets up a flow to run the decision table weekly.

- **[Custom Object with Product Discount Rules (Example)](https://help.salesforce.com/s/articleView?id=ind.reference_decision_table_example_rules_object.htm&release=264.0.0&type=5)**  
    You can use standard or custom objects to store decision table rules. In this example, an admin creates a custom object to store discount rules for orders. A decision table uses these rules to determine order discounts.
- **[Create a Decision Table to Determine Order Discount Percentage (Example)](https://help.salesforce.com/s/articleView?id=ind.task_decision_table_example.htm&release=264.0.0&type=5)**  
    After you create the custom object that contains the business rules, you can create the decision table. In this example, you use a decision table to determine order discount percentages.
- **[Create a Dataset Link to Map Order Fields (Example)](https://help.salesforce.com/s/articleView?id=ind.task_decision_table_dataset_link_example.htm&release=264.0.0&type=5)**  
    In this example, a decision table is already created to determine the discount percentage for orders. Next, create a dataset link to map the Order and Product object fields with the decision table input fields. The mapping informs the decision table of the Order and Product field values that must be evaluated to decide the discounts.
- **[Design a Flow to Update Order Discounts (Example)](https://help.salesforce.com/s/articleView?id=ind.task_decision_table_design_flow.htm&release=264.0.0&type=5)**  
    Design a flow that allows the decision table to evaluate all the Order records that don’t have a discount. The flow also updates the evaluated Order records with the discount percentage determined by the decision table.