Delete ServiceNow Table Record

Action ID: servicenow:now:table:deleteRecord
NPM Package:

@backstage-community/plugin-scaffolder-backend-module-servicenow

Description

Deletes the specified record from the specified table

Input Schema

PropertyTypeDescriptionRequired
sysIdstring-
tableNamestring-
sysparmQueryNoDomainboolean-

Output Schema

No output schema defined for this action.

Usage Examples

Delete a test Incident by sys_id

Use this to remove a test Incident created earlier in the scaffolding flow. Place this after steps like fetch:template and before publish:github if you are cleaning up test data.

Copy
steps:
  - id: deleteIncident
    action: servicenow:now:table:deleteRecord
    input:
      tableName: incident
      sysId: ${{ parameters.incidentSysId }}

Delete a Change Request across all domains

Delete a Change Request while ignoring domain separation. Use this when you need a domain-agnostic deletion such as in central cleanup jobs.

Copy
steps:
  - id: deleteChangeRequestAnyDomain
    action: servicenow:now:table:deleteRecord
    input:
      tableName: change_request
      sysId: 0f12abcdc0a8016400e0f5b5c1bdaf0c
      sysparmQueryNoDomain: true

Delete a Task while respecting domain separation

Delete a Task only within the current domain context. Use this when domain separation is enforced and you must not affect records in other domains.

Copy
steps:
  - id: deleteTaskInDomain
    action: servicenow:now:table:deleteRecord
    input:
      tableName: task
      sysId: ${{ parameters.taskSysId }}
      sysparmQueryNoDomain: false

Cleanup a CMDB CI server record after a failed provision

Use this to remove a CMDB CI server record that was created but the provisioning failed. Run this near the end of your workflow after verification steps like catalog:register.

Copy
steps:
  - id: deleteCmdbServer
    action: servicenow:now:table:deleteRecord
    input:
      tableName: cmdb_ci_server
      sysId: ${{ parameters.serverSysId }}

Remove a Service Catalog Request Item

Delete a Service Catalog Request Item created for a one-time action. Use domain-agnostic deletion when cleanup spans multiple domains.

Copy
steps:
  - id: deleteRequestItem
    action: servicenow:now:table:deleteRecord
    input:
      tableName: sc_req_item
      sysId: 7c5b1e90db220010a2b7f7a1f54bcb3b
      sysparmQueryNoDomain: true