Clear a custom field

Preview - not available in production and subject to change

Remove the value of a custom field from a case or profile.

Use clearCustomFieldValue to remove a custom field’s value from a case or profile. Identify the record with exactly one of caseId, individualProfileId or entityProfileId.

Required scope: case-management

Request

mutation clearCustomFieldValue($input: ClearCustomFieldValueInput!) {
  clearCustomFieldValue(input: $input) {
    ... on CustomFieldValues {
      customFields {
        fieldKey
        label
        text
        selectedOptions {
          key
          label
        }
      }
    }
    ... on ValidationErrors {
      errors {
        message
      }
    }
  }
}

Variables

{
  "input": {
    "caseId": "48213",
    "fieldKey": "01963b2e-4f1a-7c3d-8e5f-6a7b8c9d0e1f"
  }
}

Response

{
  "data": {
    "clearCustomFieldValue": {
      "customFields": [
        {
          "fieldKey": "01963b2e-4f1a-7c3d-8e5f-6a7b8c9d0e1f",
          "label": "Billing code",
          "text": null,
          "selectedOptions": []
        },
        {
          "fieldKey": "01963b2e-5a2b-7d4e-9f6a-7b8c9d0e1f2a",
          "label": "Client segment",
          "text": null,
          "selectedOptions": [
            {
              "key": "01963b2e-6b3c-7e5f-8a7b-8c9d0e1f2a3b",
              "label": "Private client"
            }
          ]
        }
      ]
    }
  }
}