APIs & Integrations

GVerma
Participant | Diamond Partner
Participant | Diamond Partner

Delete one of the Required property from Schema

SOLVE

I created a custom object.  When I was making some changes in the custom object, I specified event, module as required properties in my patch API call. Now I want to delete event as the required property from my schema. However, I am unable to delete it.

I want to change its schema and have only one required property module.

 

"requiredProperties": [
"module",
"event"
]

 

0 Upvotes
1 Accepted solution
dennisedson
Solution
HubSpot Product Team
HubSpot Product Team

Delete one of the Required property from Schema

SOLVE

@GVerma 

You should be able to send this:

{
    "requiredProperties": [
        "module"
    ]
}

View solution in original post

3 Replies 3
dennisedson
Solution
HubSpot Product Team
HubSpot Product Team

Delete one of the Required property from Schema

SOLVE

@GVerma 

You should be able to send this:

{
    "requiredProperties": [
        "module"
    ]
}
swise
Participant

Delete one of the Required property from Schema

SOLVE

This is not working for me. When I run the PATCH call with only a single required property it just added that property to my required properties, instead of replacing the old required property. I attempted the call again to see if with two required properties if I patched with just one if it would delete the other. It did not.

0 Upvotes
MBergenhök
Participant | Partner
Participant | Partner

Delete one of the Required property from Schema

SOLVE

I had the same problem with the PATCH call just adding the new required property to the old. But then I discovered that I still had the old required property in the 

"searchableProperties" and as  "primaryDisplayProperty".  When I replaced the old property and tried again it worked fine.
 
This is what I did
regno = old required property
regnumber = new required property

NOT working:
Request
{
  "requiredProperties": [ "regnumber" ]
}
Response
{
 "requiredProperties": [ "regno", "regnumber" ]
}
 
Working:
Request
"requiredProperties": [ "regnumber" ],
"searchableProperties": [ "regnumber""modelname" ],
"primaryDisplayProperty": "regnumber"
}
 
Response
"requiredProperties": [
"regnumber"
],
"searchableProperties": [
"regnumber",
"modelname"
],
"primaryDisplayProperty": "regnumber"
0 Upvotes