I’m trying to create a calculation property using the Properties API as Properties API documentation explains.
I’d use the Hubspot Portal instead of the Properties API to create the property, but the types of formulas allowed in the portal are quite limited.
I’ve been able to create calculation properties using the Properties API but only using formulas that don’t reference any other properties, such as “1+1” or “concatenate(‘a’,‘b’)”. Whenever I have a calculation formula that references another property, I get a generic error:
{
"status": "error",
"message": "There was a problem with the request.",
"correlationId": "179e982a-fdcf-4714-9b27-b52203a34ea6"
}
I even tried to create a calculated propery that was identical to an existing calculated property but just with a different name. I got the same error.
As an example, I used the property create API (i.e. send a POST to https://api.hubapi.com/crm/v3/properties/{object_type} )
with the following request body
{
"name": "calc_prop_from_api",
"label": "calc_prop_from_api",
"type": "number",
"fieldType": "calculation_equation",
"description": "Calculated property from app",
"groupName": "line_item_record_information",
"options": [],
"displayOrder": -1,
"calculated": true,
"externalOptions": false,
"archived": false,
"hasUniqueValue": false,
"hidden": false,
"showCurrencySymbol": false,
"formField": false,
"calculationFormula": "(quantity * price)"
}
and I get the error again:
{
"status": "error",
"message": "There was a problem with the request.",
"correlationId": "48e01572-de56-439c-863e-d76e460bd44a"
}
The calculationFormula and the rest of the JSON fields were copied directly from another property that I created in the HubSpot portal, just with a different name.
I was only able to successfully create the property when I changed the calculationFormula to something that doesn’t reference another property: “(1 * 2)”
The particular property I’m trying to create is on a custom object, but I did the same thing for a property on a deal and got the same error message. I tried it both in my account sandbox and in production. I tried it both with property creation and property updates. All return the same error.
What can I do to create a calculation property with the Properties API that allows me to use other properties in the formula?




