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"
}
}
}
}
}
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"
]
}
}
}
}
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 date of specific phases through the replace
patch operation. For more information, see Lifecycle Catalog in the user documentation.
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\":\"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": "phaseIn",
"startDate": "2020-03-12"
},
{
"phase": "active",
"startDate": "2021-05-10"
},
{
"phase": "phaseOut",
"startDate": "2025-03-30"
},
{
"phase": "endOfLife",
"startDate": "2027-01-01"
}
]
}
}
}
}
}
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
}
}
}
}