APIs & Integrations

nstansby
Participant

Set "Show in forms" through API

I'm using the v3 CRM Properties API to create all of our custom properties for Contacts, because it makes it easy for me to create the same custom properties in a developer account.  When creating a custom property through the web interface, there is a checkbox "Show in forms", but I can't find how to set that through the API.

 

When I query the properties through the v3 API, I can see whether or not it's checked in the formField property:

    {
      "updatedAt": "2020-06-11T19:47:11.133Z",
      "createdAt": "2020-06-11T19:27:28.462Z",
      "name": "days_since_last_login",
      "label": "Days since last login",
      "type": "number",
      "fieldType": "number",
      "groupName": "appinsights",
      "displayOrder": -1,
      "calculated": false,
      "externalOptions": false,
      "archived": false,
      "hasUniqueValue": false,
      "hidden": false,
      "modificationMetadata": {
        "archivable": true,
        "readOnlyDefinition": false,
        "readOnlyValue": false
      },
      "formField": false
    }

 I've tried setting "formField": true when I create the property (this is in a POST to 

/crm/v3/properties/contact😞
{
    "name": "days_since_last_login",
    "label": "Days since last login",
    "type": "number",
    "fieldType": "number",
    "groupName": "appinsights",
    "descrption": "Number of days since the last login by this contact",
    "formField": true
}

...But even when I do this, the property can not be used in forms and querying the properties shows "formField": false.  I can create the property through the API and then set this through the Web UI, but am I missing something in the API that would let me control it?

0 Upvotes
1 Reply 1
WendyGoh
HubSpot Employee
HubSpot Employee

Set "Show in forms" through API

Hey @nstansby,

 

Thanks for bringing this up!

 

On my end, when I tried to create a custom property to show up on form field by adding "formField":true, I'm seeing that the return response doesn't reflect that and is showing formField:false instead.

 

In this case, I'll have to check in with our internal team on the expected behavior. I'll keep you posted here!

0 Upvotes