Updating a Fact Sheet

Update a fact sheet through the GraphQL API.

To add, change, or delete fact sheet attributes, use the updateFactSheet mutation. Provide the attribute details using patch operations.

Some patch operations are not supported for specific attributes. For example, you can only use the replace operation for the name attribute.

id is a required argument for the updateFactSheet mutation. To learn how to get the ID of a fact sheet, see Retrieving Fact Sheets.

Updating the Name and Description on a Fact Sheet

In the following example, we change the fact sheet name and description using the replace patch operation.

Example mutation:

mutation ($patches: [Patch]!) {
  updateFactSheet(id: "28fe4aa2-6e46-41a1-a131-72afb3acf256", patches: $patches) {
    factSheet {
      id
      name
      description
    }
  }
}

Variables:

{
  "patches": [
    {
      "op": "replace",
      "path": "/name",
      "value": "AC Management Cloud"
    },
    {
      "op": "replace",
      "path": "/description",
      "value": "Application for AC management"
    }
  ]
}

Example response:

{
  "data": {
    "updateFactSheet": {
      "factSheet": {
        "id": "28fe4aa2-6e46-41a1-a131-72afb3acf256",
        "name": "AC Management Cloud",
        "description": "Application for AC management"
      }
    }
  }
}

Updating the Quality Seal on a Fact Sheet

In the following example, we set the quality seal on a fact sheet to APPROVED using the replace patch operation. For more information, see Quality Seal in the user documentation.

Example mutation:

mutation ($patches: [Patch]!) {
  updateFactSheet(id: "4d121f64-116b-4ccc-a292-eb4e4f8d1b24", patches: $patches) {
    factSheet {
      id
      name
      lxState
    }
  }
}

Variables:

{
  "patches": [
    {
      "op": "replace",
      "path": "/lxState",
      "value": "APPROVED"
    }
  ]
}

Example response:

{
  "data": {
    "updateFactSheet": {
      "factSheet": {
        "id": "4d121f64-116b-4ccc-a292-eb4e4f8d1b24",
        "name": "AC Management Cloud",
        "lxState": "APPROVED"
      }
    }
  }
}

Updating the External ID on a Fact Sheet

In the following example, we update the external ID on a fact sheet using the replace patch operation.

Example mutation:

mutation ($patches: [Patch]!) {
  updateFactSheet(id: "4d121f64-116b-4ccc-a292-eb4e4f8d1b24", patches: $patches) {
    factSheet {
      id
      name
      ... on Application {
        externalId {
          externalId
        }
      }
    }
  }
}

Variables:

{
  "patches": [
    {
      "op": "replace",
      "path": "/externalId",
      "value": "{\"type\":\"ExternalId\",\"externalId\":\"123456789\"}"
    }
  ]
}

Example response:

{
  "data": {
    "updateFactSheet": {
      "factSheet": {
        "id": "4d121f64-116b-4ccc-a292-eb4e4f8d1b24",
        "name": "AC Management Cloud",
        "externalId": {
          "externalId": "123456789"
        }
      }
    }
  }
}

Deleting the External ID from a Fact Sheet

In the following example, we delete the external ID from a fact sheet using the remove patch operation.

Example mutation:

mutation ($patches: [Patch]!) {
  updateFactSheet(id: "4d121f64-116b-4ccc-a292-eb4e4f8d1b24", patches: $patches) {
    factSheet {
      id
      name
      ... on Application {
        externalId {
          externalId
        }
      }
    }
  }
}

Variables:

{
  "patches": [
    {
      "op": "remove",
      "path": "/externalId",
      "value": ""
    }
  ]
}

Example response:

{
  "data": {
    "updateFactSheet": {
      "factSheet": {
        "id": "4d121f64-116b-4ccc-a292-eb4e4f8d1b24",
        "name": "AC Management Cloud",
        "externalId": null
      }
    }
  }
}

Updating the Life Cycle on a Fact Sheet

In the following example, we update the life cycle on a fact sheet by changing the start dates of specific phases through the replace patch operation.

Ensure to include all phases and their corresponding values in the input, even if you only want to update a single phase. Any phases that are not included in the input are deleted. For example, if you only include the plan phase in the input, the mutation will update this phase and delete all others.

The remove patch operation deletes all phases, regardless of the specific phases included in the input.

Example mutation:

mutation ($patches: [Patch]!) {
  updateFactSheet(id: "85be63bf-6347-4f20-a306-2d06a10dc6f3", patches: $patches) {
    factSheet {
      ... on Initiative {
        lifecycle {
          phases {
            phase
            startDate
          }
        }
      }
    }
  }
}

Variables:

{
  "patches": [
    {
      "op": "replace",
      "path": "/lifecycle",
      "value": "{\"phases\":[{\"phase\":\"plan\",\"startDate\":\"2019-01-12\"}, {\"phase\":\"phaseIn\",\"startDate\":\"2020-03-12\"}, {\"phase\":\"active\",\"startDate\":\"2021-05-10\"}, {\"phase\":\"phaseOut\",\"startDate\":\"2025-03-30\"}, {\"phase\":\"endOfLife\",\"startDate\":\"2027-01-01\"}]}"
    }
  ]
}

Example response:

{
  "data": {
    "updateFactSheet": {
      "factSheet": {
        "lifecycle": {
          "phases": [
            {
              "phase": "plan",
              "startDate": "2019-01-12",
              "milestoneId": null
            },
            {
              "phase": "phaseIn",
              "startDate": "2020-03-12",
              "milestoneId": null
            },
            {
              "phase": "active",
              "startDate": "2021-05-10",
              "milestoneId": null
            },
            {
              "phase": "phaseOut",
              "startDate": "2025-03-30",
              "milestoneId": null
            },
            {
              "phase": "endOfLife",
              "startDate": "2027-01-01",
              "milestoneId": null
            }
          ]
        }
      }
    }
  }
}

Updating the Status of a Fact Sheet

You may need to archive Fact Sheets to remove irrelevant or duplicate data from the Inventory. Archiving does not immediately delete a Fact Sheet but removes it from the default Inventory list. You can recover an archived Fact Sheet within the retention period, after which it is permanently deleted. For more information, see Archive and Recover a Fact Sheet in the user documentation.

You can archive or recover a Fact Sheet by updating the status attribute.

Archiving a Fact Sheet

To archive a Fact Sheet, set the status attribute to ARCHIVED and specify a reason for archiving in comment.

Example mutation:

mutation ($patches: [Patch]!) {
  updateFactSheet(id: "4d121f64-116b-4ccc-a292-eb4e4f8d1b24", comment: "Irrelevant application", patches: $patches) {
    factSheet {
      id
      status
    }
  }
}

Variables:

{
  "patches": [
    {
      "op": "add",
      "path": "/status",
      "value": "ARCHIVED"
    }
  ]
}

Example response:

{
  "data": {
    "updateFactSheet": {
      "factSheet": {
        "id": "4d121f64-116b-4ccc-a292-eb4e4f8d1b24",
        "status": "ARCHIVED"
      }
    }
  }
}

Recovering an Archived Fact Sheet

To recover an archived Fact Sheet, set the status attribute to ACTIVE and specify a reason for restoring in comment. You can recover an archived Fact Sheet within the retention period, after which it is permanently deleted.

Example mutation:

mutation ($patches: [Patch]!) {
  updateFactSheet(id: "4d121f64-116b-4ccc-a292-eb4e4f8d1b24", comment: "Recover the application from archive", patches: $patches) {
    factSheet {
      id
      status
    }
  }
}

Variables:

{
  "patches": [
    {
      "op": "add",
      "path": "/status",
      "value": "ACTIVE"
    }
  ]
}

Example response:

{
  "data": {
    "updateFactSheet": {
      "factSheet": {
        "id": "4d121f64-116b-4ccc-a292-eb4e4f8d1b24",
        "status": "ACTIVE"
      }
    }
  }
}

Updating a Custom Attribute on a Fact Sheet

To update a custom attribute on a fact sheet, specify the attribute ID in path. You can view the attribute ID (key) in the fact sheet configuration.

In the following example, we update the custom attribute serviceNowId on an application fact sheet using the replace patch operation.

Example mutation:

mutation ($patches: [Patch]!) {
  updateFactSheet(id: "4d121f64-116b-4ccc-a292-eb4e4f8d1b24", patches: $patches) {
    factSheet {
      id
      displayName
      ... on Application {
        serviceNowId
      }
    }
  }
}

Variables:

{
  "patches": [
    {
      "op": "replace",
      "path": "/serviceNowId",
      "value": "SN-123456"
    }
  ]
}

Example response:

{
  "data": {
    "updateFactSheet": {
      "factSheet": {
        "id": "4d121f64-116b-4ccc-a292-eb4e4f8d1b24",
        "displayName": "AC Management Cloud",
        "serviceNowId": "SN-123456"
      }
    }
  }
}

Updating an Attribute of the Multiple Select Type on a Fact Sheet

To update an attribute of the Multiple Select type on a fact sheet, provide the values in an array.

In the following example, we update the custom attribute supportedPlatforms on an application fact sheet with two values: macOS and windows.

Example mutation:

mutation ($patches: [Patch]!) {
  updateFactSheet(id: "2efa37b5-18aa-48d8-9d70-1328c0d856d7", patches: $patches) {
    factSheet {
      ... on Application {
        supportedPlatforms
      }
    }
  }
}

Variables:

{
  "patches": [
    {
      "op": "replace",
      "path": "/supportedPlatforms",
      "value": "[\"macOS\", \"windows\"]"
    }
  ]
}

Example response:

{
  "data": {
    "updateFactSheet": {
      "factSheet": {
        "supportedPlatforms": [
          "macOS",
          "windows"
        ]
      }
    }
  }
}