> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ServiceNow table observations

> Observe one ServiceNow table using the Table API.

Mount [app-rest](https://docs.bijection.com/integrations/native-rest.md#mount-and-bind) with
`restEndpoint` at `https://<instance>.service-now.com` and path
`/api/now/v1/table/<table>`, for example `/api/now/v1/table/incident`.
Seal a bearer credential with read access across the selected table and
fields. Bind the receiver and the mount under the same `data` label.

Initialize with
`{ profile: { mode: "provider", provider: "servicenow.table", fields: ["number", "state", "sys_updated_on"], limit: 50 } }`.
The app automatically includes `sys_id` as the upsert key. Pages request
IDs strictly after the last committed ID in ascending order. An empty
page ends the sweep, and the next sweep starts at the beginning. The app
accepts up to 100 records and 36 KiB per page. ACL filtering and concurrent
changes can affect which rows appear during a sweep. Omitted rows stay
published. This mode reads table records only.
[ServiceNow REST API query parameters](https://www.servicenow.com/docs/r/api-reference/rest-api-explorer/c_RESTAPI.html)

## Write incidents

Follow the [native write mount guide](https://docs.bijection.com/integrations/native-rest.md#native-provider-writes). Use mode `servicenow.incidents.create-update-delete` with `providerWriter`, endpoint `https://INSTANCE.service-now.com` and pass the writer in `receivers.writers` under that mode. Seal an OAuth or Basic credential with the necessary incident-table ACLs. Send one Incident object, with the field values expected by the tenant. HTTP 201 on create and 200 on update must supply `result.sys_id`. Delete accepts HTTP 204 for the exact incident and removes that record through the Table API.

The writer records evidence under the mount's label. Commands take up to 24 KiB of JSON and carry no read cursor.

[Provider write API](https://www.servicenow.com/docs/r/api-reference/rest-apis/c_TableAPI.html)

## Additional observations

Bind one protected REST mount per row in the table. Use a protected `data` label for the receiver and the mount. Call
`providerEndpoint(mode, origin, path, auth, data)` with the exact
mode and reviewed path. Initialize with
`{ profile: { mode: "provider", provider: mode, limit: 25 } }`, adding the
resource selectors below where required.

| Mode | Receiver path | Record key | Position |
| - | - | - | - |
| `servicenow.cmdb.relationships.observations` | `/api/now/v1/table/cmdb_rel_ci` | Relationship sys\_id | Ascending sys\_id keyset through an empty page |
| `servicenow.record.attachments.observations` | `/api/now/v1/table/sys_attachment` | Attachment sys\_id | Ascending sys\_id keyset through an empty page |

Each response admits at most 100 rows and 36 KiB. Oversized or malformed
pages preserve the last committed position. A terminal page restarts the
walk at the next poll. Rows missing from later responses stay published.

Use the instance origin and a bearer or Basic credential with the Table API
read ACLs. Relationships retain the parent, child, relationship type and last
update fields. Attachments require `collection` for the parent table
(for example `incident`) and `selection` for the parent record's sys\_id.
The feed reads file names, lengths and update markers.

[ServiceNow Table API](https://www.servicenow.com/docs/r/api-reference/rest-apis/c_TableAPI.html)

## Decide an approval

Pass the incident writer in `receivers.writers` under its mode, at the installed `data` label.
Mode `servicenow.approvals.decide` takes
`{ action: "decideApproval", id, decision }` under an exact command key.
`id` is the approval row's `sys_id` and the decision is `approved` or
`rejected`. Give the sealed principal Table API access and the tenant's
approval ACLs. HTTP 200 must echo the same approval row and stored state.
`detail` carries that state. The `once` receipt covers the approval row.
Downstream workflow progression depends on the tenant's business rules.
[ServiceNow Table API](https://www.servicenow.com/docs/r/api-reference/rest-apis/c_TableAPI.html)

## Capture an attachment as a File

On the protected `servicenow.record.attachments.observations` mount, bind
`receivers.serviceNowContent` to
`serviceNowAttachmentReceiver(origin, auth, data)` from
`@bijectionhq/app-rest`. Use the same instance, protected label and a credential
that can read the attachment metadata and binary. Let the metadata feed
publish the attachment and then call
`files.requestServiceNow({ id, origin })` with its `sys_id` and installed
HTTPS origin. Query `files.getServiceNow({ key })` with the returned key.

The receiver reads the Attachment API at a fixed path. It checks the
parent table, parent ID, update timestamp, modification count and size
before and after reading. Capture accepts up to 8 MiB in total and four
concurrent captures per mount. Files over 512 KiB need exact HTTP range
responses and a stable strong ETag for every range. A provider that
returns the entire body or omits that validator for a large File causes
the capture to be refused. The binary and staged parts are kept as sealed
Files at the installed label. The command has no cursor. A changed
attachment can be captured under a new observed version, and published
versions follow the installation's file retention.

On the CMDB relationships mount, use `relationships.list` or
`relationships.get` for directed parent-to-child edges. The owner is the
relationship `sys_id` and the kind is the provider's relationship type
`sys_id`. Each page commits edge changes, records and the position
together. Unobserved relationships remain published.

[ServiceNow Attachment API](https://www.servicenow.com/docs/r/api-reference/rest-apis/c_AttachmentAPI.html)

## Additional writes

Follow the [native write mount guide](https://docs.bijection.com/integrations/native-rest.md#native-provider-writes).
Pass the reviewed HTTPS endpoint, sealed credential and any listed scope
as an array to `providerWriter(mode, options, data)`. Pass the result in `receivers.writers` under its mode, on a mount with the same protected `data` label. Use a
distinct exact command key for each command. Writes accept up to 24 KiB
of JSON and carry no read cursor. Each task sends at most once.

| Mode | Scope and action |
| - | - |
| `servicenow.itsm-records.create-update-delete` | Scope is `problem`, `change_request` or `sys_user_group`. Edit or delete by sys\_id. |
| `servicenow.import-set.upsert` | Scope is one reviewed `u_` staging table. Typed `upsert` coalesces on `u_external_id`. |

Use a sealed bearer or Basic authorization credential with the selected
table's write ACLs. For Import Set upsert, configure exactly one active
synchronous transform map on the staging table and coalesce on
`u_external_id`. Send `{ action: "upsert", externalId, payload }`.
Supply the staging fields in the JSON payload as strings and pass the
coalesce value as `externalId`. A response with one inserted or updated
target row retains the row ID and transform status.

[ServiceNow Table API](https://www.servicenow.com/docs/r/api-reference/rest-apis/c_TableAPI.html)
[ServiceNow Import Set API](https://www.servicenow.com/docs/r/api-reference/rest-apis/c_ImportSetAPI.html)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.