Set validation rules for a property
Last updated: April 21, 2025
Available with any of the following subscriptions, except where noted:
|
To help maintain consistent and accurate data in your HubSpot account, you can set rules for custom text, date picker, and number properties, as well as certain default properties. When validation rules are set for a property, users must meet the property's requirements to save a value.
For example, you could create an Order Number text property where values can only contain numeric characters, or create a Payment amount number property where values can only contain up to two decimal places.
Please note: validation rules are not currently enforced when setting property values via workflows or submissions to forms created via the legacy editor. Validation rules are enforced for forms created via the new form editor.
In addition to custom text and number properties, you can set validation rules for the following default HubSpot properties:
- Company properties: Street Address, Street Address 2, Annual Revenue, City, Country/Region, Country/Region Code, Employee range, Company name, Number of Employees, State/Region, Postal Code.
- Contact properties: Street Address, Annual Revenue, City, Company Name, Country/Region, Email, First Name, Industry, Job Title, Last Name, Message, Salutation, State/Region, Postal Code.
- Deal properties: Amount, Closed Lost Reason, Closed Won Reason, Deal Name, Next step.
- Ticket properties: Ticket name.
Users must have Edit property settings permissions to set validation rules for a property.
- In your HubSpot account, click the settings settings icon in the top navigation bar.
-
In the left sidebar menu, navigate to Properties.
-
Click the Select an object dropdown menu, then select [Object] properties to create or edit a property for that object.
- To add validation rules to an existing property, click the property's name, then click the Rules tab in the right panel.
- To create a new property with validation rules, in the upper right, click Create property.
- Enter the property's details, then click the Field type tab.
- For the field type, select Single-line text, Multi-line text, Date picker, Date and time picker, Phone number, or Number, then click the Rules tab.
- Select options to turn on validation rules for property values. Depending on the field type, you'll have the following options:
- Single-line or multi-line text:
- Validate using regular expression (regex) (Professional or Enterprise only): set up validation rules using regular expressions.
- Require unique values for this property: users cannot enter the same value for multiple records. You can create up to ten unique value properties per object. This is not currently supported for feedback submissions, marketing events, or products. Learn more about how unique value properties are used to deduplicate records.
- Set a minimum character limit: users cannot enter less than the minimum character count.
- Set a maximum character limit: users cannot enter more than the maximum character count.
- Allow all characters: users can enter all character types.
- Allow numbers only: users cannot enter alphabetical and special characters except characters used in number formatting (e.g., 100.00 or 1,000).
- Don't allow special characters: users cannot enter special characters (e.g., $, %, etc.).
- Phone number or number:
- Require unique values for this property: users cannot enter the same value for multiple records. You can create up to ten unique value properties per object. This is not currently supported for feedback submissions, marketing events, or products. Learn more about how unique value properties are used to deduplicate records.
- Number:
- Set min value limit: users cannot enter a value below a specified number. For example, you set the limit to 1,000. This means users can enter values greater than or equal to 1,000.
- Set max value limit: users cannot enter a value above a specified number. For example, you set the limit to 1,000. This means users can enter values less than or equal to 1,000.
- Set max number of decimal places: users cannot enter a value that exceeds the specified number to the right of the decimal. For example, you set the limit to 2. This means users can enter values such as 123.45 or 32.1.
- Date or date and time picker: set the dates allowed for this property based on your account’s timezone.
- Any date: users can enter any date in the past or future.
- Future dates only: users cannot enter today's date or dates in the past. Select which future dates are allowed: Any future date, Any date after buffer time, or Any date in a rolling date range, then if applicable, enter the number of days.
- Past dates only: users cannot enter a future date.
- Specific date range: users cannot enter dates outside of a specified range of dates. Enter the beginning and end dates to set the range.
- Allow Monday through Friday only: users cannot enter dates that fall on Saturday or Sunday.
- Single-line or multi-line text:
- Once you're done, click Create or Save.
Learn more about creating and editing properties.