custom calculation formula for line items

Thanks to the new update, I created a custom calculation property for line items to calculate the unit price after applying a percentage discount.

The formula used is:
(unit price - (unit price * (unit discount / 100)))

When testing the property, the calculation works correctly. However, when I add this property in the line item section during quote creation, the calculation does not work as expected: it only works if the discount is entered as an absolute number rather than a percentage.

This behavior seems inconsistent, since the property test returns the correct result.

Fair warning, I just used Hub Helper Harry, a HubSpot-related GPT, to find this answer.

It suggested replacing “unit discount” with “discount_percentage”, since apparently unit discount = a currency amount.

It recommends changing your formula to: unit_price * (1 - (discount_percentage / 100)).

So if you wanted to give someone a 10% discount, in the discount_percentage property:

  • You enter 10.
  • HubSpot displays it as 10%
  • Under the hood, the value is still just 10, though, which is why you still need to divide by 100.

I hope this helps.

Robyn

Thanks so much Robyn for your help

@RNoll Now everything works, thank you very much. However, I’m having a new problem. When I try to insert it into the estimate template, I can’t find it even though I used it in the estimate construction table. Any suggestions?

Just FYI, this was generated by Hub Helper Harry again. Our company does not use the Sales Hub or Quotes.
Here’s its response:

Yes — this is expected behavior in HubSpot, and it’s not related to the formula anymore.

What’s happening

There are two different contexts in HubSpot, and they behave differently:

  1. Quote editor (estimate construction table)

    • Displays all line item properties
    • Includes custom and calculated line item properties
    • This is why the calculation works and is visible while building the estimate
  2. Estimate / quote template

    • Only displays fields that are explicitly included in the line item table configuration
    • The default line item table does not automatically expose custom line item properties (calculated or not)

So even though the property:

  • Exists
  • Calculates correctly
  • Is already used on the estimate

…it will not appear in the template unless the line item table itself is customized.

This is a template limitation, not a calculation issue.


Why you can’t find the property in the template

The most common reasons are:

1. The template uses the default line item table

The default table:

  • Supports only a predefined set of standard fields
  • Does not surface custom line item properties

2. The property is custom (calculated or not)

This is expected behavior.
Custom line item properties do not appear by default in templates unless the table is custom-configured.

3. The template was created before the property existed

In some cases, templates don’t refresh available fields automatically. Re-adding the line item table or duplicating the template can help.


What to do next (practical steps)

Option A — Use a custom line item table (recommended)

In the quote template editor:

  • Remove the default line item table
  • Insert a custom line item table
  • Manually add the calculated property as a column

This is the only reliable way to surface custom line item calculations.


Option B — Use an existing supported field

If the number must appear on quotes but not necessarily as its own column:

  • Map the value into a supported field (e.g., unit price or total)
  • Let HubSpot render it automatically

Less flexible, but simpler.


If you want, tell me:

  • Your Sales Hub tier
  • Whether this is a quote or estimate template
  • Whether you’re using the default or custom line item table

it can give you exact click-by-click steps.

I hope that helps!

Robyn