Update multiple options property via API

Hi,

I am using the API to create new deals and contacts in HubSpot from our own website forms. Now we have added a new multi-option “Category” property to our contacts. Our problem is as follows: When a new customer submits a request via our web form, a new customer is created and everything is fine. But what happens to our category property when an existing customer submits a webform request? I think the property is overwritten and if the category was “A” and “B” and the customer sends an “A”, the “B” is lost, right? Is there a way to add an option to a property without completely overwriting it and without having a complicated read → add → overwrite process? I mean something like “add” instead of “overwrite” for a property during an update?

I hope my question is formulated clearly. Thanks for your answers!

Kind regards,

Markus

Hi, @MWatermeyer :waving_hand: Thank you for your question.
You’re correct in your understanding that the multi-select property gets overwritten with the new value rather than being appended. This is the default behaviour of the HubSpot API for multi-select properties.

It’s not possible to append values directly to multi-select properties. In this case, isn’t a straightforward way to avoid the “read → add → overwrite” process you’ve described.

This will involve, in some manner, depending on your use case and set up:

  • Reading the current property value(s) for the contact
  • Adding the new value to the existing ones
  • Overwriting the old values with the new set of values

Hey, @BarryGrennan @albertsg @ChrisoKlepke, do you have any suggestions for @MWatermeyer? Or big picture steps you might take to build something like this?

Thank you very much for taking a look! — Jaycee

If you want to update an existing record without overwriting the existing values, adding a semi-colon to the start will work.

{
 "property_name":";new_internal_value"
}

You can perform tests with your own data here