CompanyPropertiesFile Parameter (Connect-HubSpot Cmdlet)
Specifies a comma-separated list or file path containing the names of fields to retrieve for the Companies table.
Syntax
Connect-HubSpot -CompanyPropertiesFile string
Data Type
cstr
Default Value
""
Remarks
Use this property to limit the fields selected from the Companies table, especially when working with a large number of custom properties. In HubSpot, querying all fields at once may result in API errors due to field limits.
You can set this property to either:
- A comma-separated list of field names (for example, "industry,annualrevenue,description").
- The full file path to a text file containing a comma-separated list of API field names (for example: C:\Users\Public\Documents\customfields.txt).
The field names must match the internal (API) names used by HubSpot. You can retrieve these names from the Name column of the CompanyProperties table.
This property is especially useful in environments where you do not have direct control over the SQL query like reporting tools or middleware.
Performance Considerations
Limiting the selected fields can reduce API response size and improve query performance, especially when working with companies that have a large number of custom properties. This also helps avoid errors related to API field count or payload size limits.