Properties
Use properties to store information on CRM records. HubSpot provides a set of default properties for each CRM object, and you can also create and manage your own custom properties either in HubSpot or using the properties API.
When creating properties, it’s important to consider how to architect your data. In many cases, creating custom properties for HubSpot's standard objects is the right course of action. However, there may be times when you'll need to create a separate custom object with its own set of properties.
Property groups are used to group related properties. Any grouped properties will appear next to each other on HubSpot records. If your integration creates any custom object properties, a custom property group will make it easy to identify that data.
When creating or updating properties, both type
and fieldType
values are required. The type
value determines the type of the property, i.e. a string or a number. The fieldType
property determines how the property will appear in HubSpot or on a form, i.e. as a plain text field, a dropdown menu, or a date picker.
In the table below, learn about the available property type
and corresponding fieldType
values.
type |
Description | Valid fieldType values |
---|---|---|
bool |
A field containing binary options (e.g., Yes or No , True or False ). |
booleancheckbox , calculation_equation |
enumeration |
A string representing a set of options, with options separated by a semicolon. | booleancheckbox , checkbox , radio , select , calculation_equation |
date |
A value representing a specific day, month, and year. Values must be represented in UTC time and can be formatted as ISO 8601 strings or EPOCH-timestamps in milliseconds (i.e. midnight UTC). | date |
dateTime |
A value representing a specific day, month, year and time of day. The HubSpot app will not display the time of day. Values must be represented in UTC time and can be formatted as ISO 8601 strings or UNIX-timestamps in milliseconds. | date |
string |
A plain text strings, limited to 65,536 characters. | file , text , textarea , calculation_equation , html |
number |
A number value containing numeric digits and at most one decimal. | number , calculation_equation |
Valid values for fieldType
include:
Fieldtype | Description |
---|---|
booleancheckbox
| An input that will allow users to selected one of either Yes or No. When used in a form, it will be displayed as a single checkbox. |
calculation_equation
| A custom equation that can calculate values based on other property values and/or associations. |
checkbox
| A list of checkboxes that will allow a user to select multiple options from a set of options allowed for the property. |
date
| A date value, displayed as a date picker. |
file
| Allows for a file to be uploaded to a form. Stored and displayed as a URL link to the file. |
number
| A string of numerals or numbers written in decimal or scientific notation. |
radio
| An input that will allow users to select one of a set of options allowed for the property. When used in a form, this will be displayed as a set of radio buttons. |
select
| A dropdown input that will allow users to select one of a set of options allowed for the property. |
text
| A plain text string, displayed in a single line text input. |
textarea
| A plain text string, displayed as a multi-line text input. |
html
| A string, rendered as sanitized html, that enables the use of a rich text editor for the property. |
Calculation properties define a property value based on other properties within the same object record. They are defined using a formula, which may include operations like min, max, count, sum, or average. You can use the properties API to read or create calculation properties in your HubSpot account, using a field type of calculation_equation
and a type of number
, bool
, string
, or enumeration
.
You can define the property's calculation formula with the calculationFormula
field.
Using calculationFormula
, you can write your formula with arithmetic operators, comparison operators, logic operators, conditional statements, and other functions.
Literal syntax
- String literal: constant strings can be represented with either single quotes (
'constant'
) or double quotes ("constant"
). - Number literal: constant numbers can be any real numbers, and can include point notation.
1005
and1.5589
are both valid constant numbers. - Boolean literal: constant booleans can be
true
orfalse
.
Property syntax
- String property variables: for an identifier string to be interpreted as a string property, it must be wrapped in the
string
function. For example,string(var1)
will be interpreted as the value for the string property var1. - Number property variables: all identifiers will be interpreted as number property variables. For example,
var1
will be interpreted as the value for the number property var1. - Boolean property variables: for an identifier to be interpreted as a bool property, it must be wrapped in the
bool
function. For example, the identifierbool(var1)
will be interpreted as the value for the boolean property var1.
Please note: the language used is case sensitive for all types except strings. For example, If A ThEn B
is exactly the same as if a then b
but 'a'
is not the same as 'A'
. Spaces, tabs, and new lines will be used for tokenization but will be ignored.
Operators
Operators can be used with literal and property values. For arithmetic operators, you can use prefix notation to multiply, and parenthesis can be used to specify the order of operations.
Operator | Description | Examples |
---|---|---|
+
| Add numbers or strings. |
|
-
| Subtract numbers. | property1 + 100 - property2 |
*
| Multiply numbers. | 10property1 = 10 * property1 |
/
| Divide numbers. | property1 * (100 - property2/(50 - property3)) |
<
| Checks if a value is less than another. Supported by number properties or constants. | a < 100 |
>
| Checks if a value is greater than another. Supported by number properties or constants. | a > 50 |
<=
| Checks if a value is less than or equal to another. Supported by number properties or constants. | a <= b |
>=
| Checks if a value is greater than or equal to another. Supported by number properties or constants. |
|
=
| Checks if a value is equal to another. Supported by both numbers and strings. | (a + b - 100c * 150.652) = 150-230b |
equals
| Checks if a value is equal to another. Supported by both numbers and strings. | a + b - 100.2c * 150 equals 150 - 230 |
!=
| Checks if a value is not equal to another. Supported by both numbers and strings. | string(property1) != 'test_string' |
or
| Checks if either or two values are true. | a > b or b <= c |
and
| Checks if both values are true. | bool(a) and bool(c) |
not
| Checks if none of the values are true. | not (bool(a) and bool(c)) |
Functions
The following are supported functions:
Function | Description | Examples |
---|---|---|
max
| Will have between 2 and 100 input numbers, and will return the maximum number out of all the inputs. | max(a, b, c, 100) or max(a, b) |
min
| Will have between 2 and 100 input numbers, and will return the minimum number of out all the inputs. |
|
is_present
| Evaluates whether an expression can be evaluated. |
|
contains
| Has two strings as inputs and will return true if the first input contains the second. |
|
concatenate
| Joins a list of strings. The list of inputs can go from 2 up to 100. |
|
There are also two parsing functions:
number_to_string
: tries to convert the input number expression to a string.string_to_number
: tries to convert the input string expression to a number.
For example, "Number of cars: " + num_cars
is not a valid property because you can't add a string with a number, but "Number of cars: " + number_to_string(num_cars)
is.
Conditional statements
You can also write your formula with conditional statements using if
, elseif
, endif
, and else
.
For example, a conditional statement could look like: if boolean_expression then statement [elseif expression then statement]* [else statement | endif]
where the [a]
brackets represent that a is optional, the a|b
represent that either a or b will work, and *
means 0 or more. endif
can be used to finish a conditional statement prematurely, ensuring that the parser can identify which if
the next elseif
belongs to.
Example formulas
The following are examples you can use to help define your own calculation formulas:
A more advanced example with conditionals:
Thank you for your feedback, it means a lot to us.