How to send Arrays as properties

I am creating a deal and I have a property named more_services which should take an array of services like:
[“marekting Package” , “Listing Price”,“Professional Photos”]
The JSON I am sending is :

{

“properties”:

[

{ “value”: “4818 New Baton Rouge Drive or whatever”,“name”: “dealname” },

{ “value”: “4536129”, “name”: “dealstage” },

{ “value”: “1206455”, “name”: “pipeline” },

{ “value”:“Approved”,“name”:“listing_application_status”},

{“value”:“2400000”,“name”:“listing_price”},

{ “value”: [“marketing Package”,“listing_price”,“Listing Price”], “name”: “more_services” },

{ “value”: “Basic”, “name”: “package_type” },

{“value”:“4818 New Baton Rouge Drive or whatever” , “name”:“property_address”},

{ “value”: “newbusiness”, “name”: “dealtype” } ]

}
Upon submission I am running into this issue :

“status”: “error”,

“message”: “Invalid input JSON on line 9, column 20: Encountered START_ARRAY token for non-repeated field com.hubspot.properties.data.PropertyValue.value”,

Is there something I am missing ?

Hi @Aizaz ,

What field type is your ‘more_services’ property? You can not store arrays directly in the CRM based on the available property types.
You can however store JSON or plain text in a single line text or multiline text field and decode that in HubSpot in a module (for example in a custom quote template). One approach I often use is setting a comma-separated list in HubSpot ‘“marketing Package”,“listing_price”,“Listing Price”’ and using the |split filter to get an array.

If however, you try to store these values in a multi-select property, then you need a different approach.

It is of the type select boxes

Ah, in that case, you need to separate each value by a semicolon.

So instead of passing

{ "value": ["marketing Package","listing_price","Listing Price"], "name": "more_services" },

You should pass:

{ "value": "marketing Package;listing_price;Listing Price", "name": "more_services" },

oh wow. that’s simpler than I thought. Thanks !

Hello @Teun and everyone,

In products, we have a list of URLs we need to display in the multiline text field. I understand we will send a text delimited by a comma-separated and then use split to get an array. Then show the variety of elements in the field.

Where do we code the split?

{% set string_to_split = "Stephen; David; Cait; Nancy; Mike; Joe; Niall; Tim; Amanda" %}
{% set names = string_to_split|split(";", 4) %}
<ul>
{% for name in names %}
 <li>{{ name }}</li>
{% endfor %}
</ul>

Hi! Did you get an answer to this? Thanks!