ECommerce Bridge - how to represent boolean property?


#1

I have created a custom product property that is of type "bool" and would like to sync that property using the Sync Messages API available with the ECommerce Bridge.

Looking at the documentation for PropertyMapping fields, "dataType" can be one of a few options: "STRING", "NUMBER", "DATETIME", "AVATAR_IMAGE"

Obviously boolean is not in that list. So what dataType should I use for this boolean field?


ECommerce Bridge - Delayed Sync Messages
#2

@Walter_Anderson

Use the STRING property mapping type.
Define the Hubspot property as a boolean property.
When you send sync messages, send with values of "true" or "false"

The Sync property types are a bit odd, and we should clean it up a bit.. or at least document this better.


#3

@Sean_Duane

Thanks for the response! I'll go ahead and set up any boolean values as strings in the property mapping.

And yes, better documentation is always good :slight_smile:


#4

So I've updated the sync settings to include my boolean property as a string, but when I send a sync message that contains this property, I'm not seeing it propagate out to the actual entity. The sync errors endpoint isn't returning anything so it seems like it accepted my sync message.

Here's some context for how I have this property set up. Do you see any issues with this configuration?

The product property (/properties/v1/products/properties):

{
    "name": "in_stock",
    "label": "In Stock",
    "description": "If this product is in or out of stock",
    "groupName": "productinformation",
    "type": "bool",
    "fieldType": "booleancheckbox",
    "hidden": false,
    "options": [
        {
            "doubleData": 0,
            "hidden": false,
            "label": "True",
            "description": null,
            "displayOrder": -1,
            "readOnly": false,
            "value": "true"
        },
        {
            "doubleData": 0,
            "hidden": false,
            "label": "False",
            "description": null,
            "displayOrder": -1,
            "readOnly": false,
            "value": "false"
        }
    ],

The sync setting (/extensions/ecomm/v1/settings):

{
    "propertyName": "in_stock",
    "dataType": "STRING",
    "targetHubspotProperty": "in_stock"
}

And then here's the sync message I'm sending (/extensions/ecomm/v1/sync-messages/PRODUCT):

[
  {
    "integratorObjectId": "108",
    "action": "UPSERT",
    "changeOccurredTimestamp": 1531328487008,
    "propertyNameToValues": {
      "in_stock": "false"
    }
  }
]

#5

@Walter_Anderson That all looks correct to me. What's your portalId? I can take a peak


#6

Do you mean Hub ID? It's 2252779


#7

@Walter_Anderson Thanks. Everything looks good here.. still trying to figure out why it's not syncing. Some follow up questions. It looks like you sent sync messages yesterday (july 11th):

  • Did you define this boolean property yesterday (july 11th)?
  • Did you add the mapping yesterday with the boolean property?

I wonder if this is a cache issue. What happens if you send a sync message now, for just the boolean property?


#8

@Sean_Duane I believe I did define the property on July 11th. Starting on July 12th I began experiencing extremely large delays in between sending a sync message and it processing in Hubspot's UI. One message I sent yesterday morning took 2-3 hours to process. Another message I sent took all night.

It seems like this issue of sync messages processing may be not be isolated to this specific property.


#9

@Walter_Anderson Yeah, I think this is a cache bug. I'll work on a fix now.

fyi, there is a system that attempts to sync the message right away, which works most of the time. Failed messages are reprocessed in a slower queue, which can take.. hours, days, it depends.

The slow queue needs to be optimized, but it will take time to get back to that one.

I'll put in a fix for this property cache, and let you know.


#10

@Sean_Duane Do you think this caching bug is the root issue for why I'm seeing delays across all sync messages? Or is this only affecting messages that contain that specific property?


#11

@Walter_Anderson I deployed a fix.

I'm pretty sure this delay was caused by a new property, and the fast sync process didn't pick up the new property. Thus it threw away that part of the sync message, saying "This property isn't defined on the portal"

If you see more messages from here that are delayed (like, 10+ minute delays), make another post and derrick or I will dig in more.

Appreciate you bringing these issues up. It will take time to mature the Sync process, and feedback like this goes a huge way :slight_smile: