Skip to main content

saveCustomField

Requires permission settings:custom-fields:manage.

Adds a custom field, or changes an existing one's settings. The key and kind of record never change, and the type cannot change once records hold values or while an enabled approval rule tests the field. Requires permission to manage custom fields.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation SaveCustomField($input: SaveCustomFieldInput!) {
saveCustomField(input: $input) {
id
type
archived
carryForward
defaultValue
editPermission
}
}

Variables:

{
"input": {
"entity": "string",
"key": "string",
"labels": {},
"placements": [
"string"
],
"required": true,
"type": "string",
"visibility": "string"
}
}

Response:

{
"data": {
"saveCustomField": {
"id": "id",
"type": "string",
"archived": true,
"carryForward": true,
"defaultValue": {},
"editPermission": "string"
}
}
}
saveCustomField(
input: SaveCustomFieldInput!
): CustomFieldDefinition!

Arguments​

saveCustomField.input ● SaveCustomFieldInput! non-null input​

The field and its settings.

Type​

CustomFieldDefinition object​

A field the organization added to one kind of record.