Introduction
Note: This functionality is currently in public beta - read more about Upgrading Templates to use Line Item Calculations
LinePilot makes it easy to fill out the properties of your line items in many different ways. These can be fixed values data from your deal or even calculations are using logic using our new Line Item Calculations engine.
Here are a few examples to give you some inspiration:
- Add a discount for renewing customers
- Calculate the price based on the volume and location of the customer
- Add a fee or charge that a percentage of the overall deal amount
- Set the contract start date to be the end of the current month
In this article will run through the basics of how to use the tool. If you need any help getting started working out the best way to implement your used case then get in touch with the team we'd be happy to help.
The basics
LinePilot lets you choose how to fill out each property on the line item with an easy to use input box.
There are 4 main types of content you can put in here:
- Text or Numbers (Static) - just type the text or number you want filled out on your line item - this will be the same every time LinePilot runs
- Option Values (Static) - when you have a drop down menu inside HubSpot, you can choose those values inside LinePilot
- Tokens - such as properties on your deal or from the product
- Functions - allow you to use advanced logic or calculations - similar to using a spreadsheet or HubSpot's own calculations tool
And of course, you can use a combination of all four. Tokens and Functions are easy to add - just click the "Insert" function on the right hand side of the input box.
Read on if you want to find out more about the different types of content you can enter.

What are properties?
Line Items contain properties just like any other object in HubSpot. There are a set of standard properties such as:
- Name
- Quantity
- Unit Price
- Billing Frequency
You can display line item properties inside HubSpot by selecting "Edit columns" when viewing line items.

When adding line items in LinePilot you can choose the values for each line item you're adding. If you're adding a Product or using the Product Selector tool, you can override the values from the HubSpot product library.
To get started, just search for the property you need in the box marked "Add properties".

Alongside the standard properties like Unit Price, Cost, Description, in HubSpot you can also add custom properties to Line Items (note that these are edited from Product Properties in HubSpot). Adding values to Custom properties require a LinePilot Pro subscription and you'll see these properties marked with an Orange "Pro" icon.
Tokens
Tokens are pre-set values that you will see inside the input box. They can be static or dynamic, but they are easy to use.
Property option values
Properties that have a drop down list of options will show the options underneath the input box, ready to be selected. They will also filter when you start to type one of the options. Using these tokens will make sure the right option is selected in HubSpot when your line item is calculated. If you're editing a property that supports multiple options, you need to separate them with a semicolon:
UK;France;Germany
Deal properties
Available from the "Insert" menu. A deal property token simply grabs the data from the deal that the template is running on.
Deal Name
Product properties
Available from the "Insert" menu when your line item is a Product, or a Product Selector. Pulls the data from the product library. Helpful if you want to add or change the product data, e.g. add text to the end of the description, or edit the unit price.
Unit Cost
Date properties
Available from the "Insert" menu. Uses the date that the template is being run to populate values. See more info about dates
End of month
Simple Math
If your line item property is a number, or you're working with a function, you can use any common mathematic operations as part of a simple formula. Simply type these into the box to calculate the values. You can use tokens here too. A couple of helpful functions when working with numbers are round() and convert_to_currency().
Operator | Definition and Example |
---|---|
+ | Add Amount + 100 |
- | Subtract Unit Price - Deal Discount |
* | Multiply Volume * 0.75 |
/ | Divide Amount / Total Units |
( ) | Brackets (Unit Cost * 2) + 100 |
Functions
Functions let you do more complex logic and give you helper functions for common use cases. Available from the "Insert" menu.
Each function has one or more "arguments" separated by commas, between brackets. To make it easy to keep track, we will show what each argument is above the cursor when you're filling it out.
You can use tokens, maths and other functions inside the arguments. You can nest functions inside each other up to a depth of 5 functions.
Function | Definition and Example |
---|---|
if(condition, value_if_true, value_if_false) | Check against a condition (see Logic for more details)if(Deal type == "Existing", 20, 30) |
if_empty(to_check, value_if_empty, value_if_not) | Check to see if a value is emptyif_empty(Discount, 0, Discount) |
contains(to_check, term_to_search) | Check to see if text includes some other textif(contains(Deal Name, "Monthly"), Annual, Monthly) |
round(number, precision) | Round a number to a specified precisionround(Unit Cost / 3, 2) |
uppercase(text) | Make text uppercase uppercase("This is my Deal Name ") |
lowercase(text) | Make text lowercaselowercase(SKU) |
capitalise(text) | Capitalise each letter capitalise(Product name) |
convert_to_currency(number,currency_from,currency_to) | Convert a value from one currency to another using the exchange rates set in HubSpotconvert_to_currency(Unit Price,Deal currency,"GBP") |
format_date(date, format) | Format a date using date tokens - see this article for available tokensformat_date(Today,"mmm yy") |
add_days(date,daysToAdd) add_months(date,monthsToAdd) add_years(date,yearsToAdd) | Adds days/months/years to a supplied date. Negative values are accepted as welladd_months(Contract Start Date,Term in Months) |
days_between(date1,date2) | Get the difference in days between 2 datesdays_between(Close Date,Contract Start Date) |
Using strings in functions
If you are using static text inside a function, or using a combination of text and tokens, then you should use double-quotation marks around the value:
For example:
lowercase("Hello")
lowercase("Hello Deal Owner")
lowercase("Deal Name Deal Description")
If you're just using a token directly - then you don't need to use quotation marks:
lowercase(Deal Owner)
Logic
For if statements you can also use logic to compare two values, these values can be tokens.
Operator | Definition and Example |
---|---|
== | Equal if(Contract Length == "1 yr", 12, 24) |
!= | Not equal if(Training Required != "Yes", 0, 2000) |
< | Less thanif(Volume < 100, Unit Price, Discounted Price) |
> | Greater thanif(Today > Contract Start, Contract Start , End of Month ) |
<= | Less than or equal if(Volume <= 99, Unit Price, Price for 100+) |
>= | Greater than or equal if(Seats >= 20, Unit Price, Price for under 20 Seats) |
Getting Help
Need help working out some logic for your template? Trying to troubleshoot a calculation? Our team are standing by to help - just head to our support page to get in touch or book a call.