Marketo field limits, Supplemental: Don't trust the *Describe* API, either

It's becoming exhausting to keep up with the errors in the official Marketo field limits doc. The majority of the time I've tested a claimed limit, it's turned out to be wrong. ☹️

I've done posts on Number types, the URL type and on numeric and alphanumeric Strings. And of course the recent one on the totally broken Float and Currency types as well.

Granted, docs may be simplified somewhat for general consumption. (Marketo surely doesn't want to publish an entire post on each type… though come to think of it, why not?) But that's no excuse for mistakes that can lead — and, I'm 100% sure, have led — to broken integrations.

So today I want to touch on a related topic: while the Describe Lead API endpoint can supply better data than the official doc in some cases, but it too isn't to be trusted (even though you'd think it reflected the database-level reality).

I'll be relatively brief and concentrate only on the String type. Or String types, I should really say. Because even though the above doc claims that all Strings are 0‑255 characters long, in fact the Describe endpoint reveals that some String fields max out at (a lot) less than 255 characters, and other String fields accept (a lot) more than 255 characters.

Check out these excerpts from the Describe response on one of my instances:

{
    "id": 462,
    "displayName": "Marketo Social Facebook Profile URL",
    "dataType": "string",
    "length": 2000,
    "rest": {
        "name": "facebookProfileURL",
        "readOnly": false
    },
    "soap": {
        "name": "MarketoSocialFacebookProfileURL",
        "readOnly": false
    }
},
{
    "id": 526,
    "displayName": "Group Membership",
    "dataType": "string",
    "length": 4099,
    "rest": {
        "name": "Group_Membership__c",
        "readOnly": false
    },
    "soap": {
        "name": "Group_Membership__c",
        "readOnly": false
    }
},
{
    "id": 543,
    "displayName": "Spouse",
    "dataType": "string",
    "length": 60,
    "rest": {
        "name": "Spouse__c",
        "readOnly": false
    },
    "soap": {
        "name": "Spouse__c",
        "readOnly": false
    }
},
{
    "id": 511,
    "displayName": "Business Unit",
    "dataType": "string",
    "length": 255,
    "rest": {
        "name": "Business_Unit__c",
        "readOnly": false
    },
    "soap": {
        "name": "Business_Unit__c",
        "readOnly": false
    }
}

As you can see, for 4 ostensible String fields, there are 4 different size limits! The different limits aren't only explained by the SFDC origin of the fields (though that certainly contributes) since the first field is Marketo-only. And the limits aren't just cosmetic, they are enforced by the API, as shown here for a Spouse attempt with 61 letters:

{
   "code": "1003",
   "message": "Value for field 'Spouse__c' exceeds max length"
}

On the other hand, some fields will allow more characters than the supposed limit to be entered via the Marketo UI, and read via API without truncation. But not written via API. It's completely maddening. I don't think anyone, and I mean anyone, has built a full-circle integration that respects the correct field limits at every point. Not a happy takeaway, but there it is!