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
-
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.
-
Ensure the table includes all products and quantity-based discount variations.
-
Download the lookup table as a CSV file.
Step 2: Upload the Lookup Table
- Navigate to Workflow in PandaDoc main manu.
- Locate the Lookup Tables tab.
- Create a table by uploading prepared CSV file.
- 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
- Open the Rules Section in the Code Builder.
- 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.
- Select the Match Lookup Table operator.
- Define conditions:
LineItem.SKU = LookupTable.VolumeDiscounts.SKU
LineItem.Quantity >= LookupTable.VolumeDiscounts.MinQuantity
LineItem.Quantity <= LookupTable.VolumeDiscounts.MaxQuantity - Update the discount column in the quote by referencing the Discount column from the lookup table:
LineItem.Discount = LookupTable.VolumeDiscounts.Discount
- Ensure the Discount column exists in the quote before applying the rule.
- Save the rule.
Step 4: Test the Rule
- Add products to the quote from the catalog using SKUs.
- Set different quantities for each product.
- Verify that the discount is applied correctly based on lookup table data.
- 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! 🎯