Skip to main content

Updating Products in a Quote Based on Lookup Table Data

Overview

This guide explains how to apply volume-based discounts dynamically in a quote by leveraging lookup tables and rules. This allows users to match line items in a quote with predefined discount rules based on quantity and product SKU.

Watch the Video Tutorial


Step 1: Prepare the Lookup Table

  1. Create a lookup table with the following columns:

    • SKU: The product identifier.
    • Minimum Quantity: The lower bound of the quantity range.
    • Maximum Quantity: The upper bound of the quantity range.
    • Discount (%): The discount percentage applicable for the specific SKU and quantity range.
  2. Ensure the table includes all products and quantity-based discount variations.

  3. Download the lookup table as a CSV file.

volume_based_table_gsheet.png

Step 2: Upload the Lookup Table

  1. Navigate to Workflow in PandaDoc main manu.
  2. Locate the Lookup Tables tab.
  3. Create a table by uploading prepared CSV file.
  4. Assign a recognizable name (e.g., Volume Discounts).

Once uploaded, the system will process the table and confirm the number of rows and columns.


Step 3: Create a Rule to Apply Discounts

  1. Open the Rules Section in the Code Builder.
  2. Iterate through each line item in the quote and match it with the lookup table:
    • Match by SKU: The SKU in the quote must match the SKU in the lookup table.
    • Check Quantity Range: The quantity in the quote should be between the Minimum Quantity and Maximum Quantity in the lookup table.
  3. Select the Match Lookup Table operator.
  4. Define conditions:
    LineItem.SKU = LookupTable.VolumeDiscounts.SKU
    LineItem.Quantity >= LookupTable.VolumeDiscounts.MinQuantity
    LineItem.Quantity <= LookupTable.VolumeDiscounts.MaxQuantity
  5. Update the discount column in the quote by referencing the Discount column from the lookup table:
    LineItem.Discount = LookupTable.VolumeDiscounts.Discount
  6. Ensure the Discount column exists in the quote before applying the rule.
  7. Save the rule.

Step 4: Test the Rule

  1. Add products to the quote from the catalog using SKUs.
  2. Set different quantities for each product.
  3. Verify that the discount is applied correctly based on lookup table data.
  4. Try different products and quantities to ensure:
    • The correct SKU is identified.
    • The corresponding quantity range is matched.
    • The correct discount is applied.

Example

  • Product A (SKU: 1234), Quantity: 50 → Discount: 38%
  • Product B (SKU: 5678), Quantity: 100 → Discount: 50%
  • Product C (SKU: 91011), Quantity: 200 → Discount: Different rate based on table

Summary

By using lookup tables and rules, you can create custom volume-based discounting without relying on built-in discount logic. This method provides greater flexibility and ensures that discounts are applied dynamically based on product SKU and quantity.

🚀 Now, go ahead and implement your own automated discounting rules! 🎯