CRM_objects function values with spaces

Hey guys

Trying to query a options property where one of the options has special characters like the image bellow

The query is

{% set test_event = crm_objects("custom_object",'limit=100&property_type__contains=Land Development','address,property_type') %}

Just like this suggested https://community.hubspot.com/t5/CMS-Development/Special-Characters-in-crm-objects-query/m-p/1025074#M40235

But that is not working, any ideas on how to solve this?

Hi, @ACarrillo7 :waving_hand: Thanks for your question. I appreciate you including your example. I’d like to ask some of our community champions if they have been successful making a query like this — hey @evaldas @alyssamwilie @Anton, do you have any additional suggestions for @ACarrillo7?

Thank you very much! — Jaycee

Hey @ACarrillo7,

I’d try to encode it like

{% set test_event = crm_objects("custom_object",'limit=100&property_type__contains=Land%20%26%20Development','address,property_type') %}

Element encoded variant
’ ’ (space) %20
& %26

or chage it to the string_startingwith expression test like

{% set test_event = crm_objects("custom_object",'limit=100&property_type__string_startingwith=Land','address,property_type') %}

best,

Anton

Much thanks for your quick response,

I removed the character “&” from the property value (so the property option is now “Land Development” instead of “Land & Development”), and it worked. Understandable but still a bit weird

@Anton I didn’t have any luck with the encoding or the “startswith” option.

I think there might be a bug that made it’s way in or a change happened that I am not aware of because even if you just use one of the words, it does not return any results:

{% set test_event = crm_objects("custom_object",'limit=100&property_type__contains=Land','address,property_type') %}

Logically this should work. This actually works if the property is a plain text property but does not return any results if it’s a dropdown select property (which has an internal value).

Thanks for your quick response,

It seems to be a bug. I removed the character “&” from the property value (so the property option is now “Land Development” instead of “Land & Development”), and it worked. Understandable but still a bit weird.