Step 4: Update an Existing Custom Field
For clients currently using the Custom Fields: Update
endpoint, the Configuration equivalent is Resource Configuration: Update
if you want to overwrite the existing custom field entirely or Resource Configuration: Patch
if you just want to update a few attributes of the custom field.
Custom Fields: Update
could only update name, group, description, alternate language behavior, and the available options. With the Resource Configuration endpoints, you can add more restrictive validation.
Notable Callouts
- You still cannot change the resource type in an Update call.
Comprehensive Update
If there was a minimum length validation specified before making this call, the PUT
call would remove it.
Custom Fields API
Custom Fields: Update
{
"name":{
"value":"Country Full Name"
},
"description":{
"value":"I'm adding a description here"
}
}
Resource Configuration API
Resource Configuration: Update
{
"$id": "c_countryFullName",
"$schema": "https://schema.yext.com/config/km/field/v1",
"displayName": "Country Full Name",
"group": "NONE",
"localization": "PRIMARY_ONLY",
"type": {
"stringType": {
"stereotype": "SIMPLE",
"maxLength": 100
}
},
"typeId": "string"
}
Partial Update
If there was a minimum length validation specified before making this call, the PATCH
call would not remove it.
Custom Fields API
Custom Fields: Update
{
"name":{
"value":"Country Full Name"
},
"description":{
"value":"I'm adding a description here"
}
}
Resource Configuration API
Resource Configuration: Patch
{
"$id": "c_countryFullName",
"$schema": "https://schema.yext.com/config/km/field/v1",
"displayName": "Country Full Name",
"group": "NONE",
"localization": "PRIMARY_ONLY",
"typeId": "string"
}
Feedback
<% elem.innerText %>