Skip to main content
The UI extensions SDK provides a formatCrmProperties utility that applies HubSpot’s standard display formatting to CRM property values. This helps keep your extension consistent with HubSpot’s UI, and is particularly useful when you get raw property values from:
You don’t need to use this function for values returned by the useCrmProperties or useCrmSearch hooks, as they provide their own formatting options.

Usage

formatCrmProperties accepts raw property values and returns them with HubSpot’s standard display formatting applied. By default, it formats recognized property types. For example, it formats phone numbers and numeric values, and resolves enumeration values to their display labels. You can optionally use the formattingOptions prop to customize how dates, datetimes, and currencies display. The function accepts either a single property map or an array of property maps, and returns the same shape it receives.

Parameters

formatCrmProperties fetches property definitions for the object type over the network. Because calls can fail, it’s best to wrap them in a try/catch to handle rejections.

Formatting options

The formatCrmProperties function applies HubSpot’s standard display formatting to recognized property types even without formattingOptions. However, you can use the formattingOptions prop to customize how date, datetime, and currency properties display. Below are the available options for the formattingOptions parameter. The following example applies currency, date, and datetime formatting to a deal’s properties:

Return value

The function returns a Promise that resolves to:
  • A single Record<string, string | null> when properties is a single object.
  • An Array<Record<string, string | null>> when properties is an array.
The result order matches the input order when an array is provided. Property values that are null in the input are preserved as null in the output. The function handles the following edge cases:
  • If you pass an unknown property name, the function will return its value unchanged.
  • If you pass an empty array, the function will return [].
  • If you pass an invalid objectType, the promise will reject.
Last modified on June 3, 2026