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

# ServiceNow

> Import ServiceNow data, configure custom tables, and troubleshoot access.

## Configuration

This section describes the data import **from** ServiceNow. Information on how to write back data to the CMDB can be found in [ServiceNow Writer](https://doc.qbilon.io/07-data-consolidation-writer/servicenow-writer.md).

Importing data from ServiceNow requires the following information:

| **Name** | **Explanation** |
| - | - |
| Host | URL of the ServiceNow server, e.g., [https://mycompany.servicenow.com](https://mycompany.servicenow.com/) |
| Username | username for accessing the server |
| Password | password for accessing the server |
| Services (deprecated) | predefined selection of tables to import |
| Custom tables (recommended) | free specification of custom tables with optional query to load from the ServiceNow database |
| Execution Settings | import execution pattern can be set to "Onetime", "Scheduled" (recurring according to certain time interval) or "Dependency" (each time after a specific other data source is executed). |

**Table**: ServiceNow Connector Settings

After the automation task has been added and executed, you can click on the task tile to see its details on the right panel. Here, Qbilon shows the three tabs "Data Source Details", "Warning & Errors" (cf. [Warnings and Errors](https://doc.qbilon.io/06-data-sources/warnings-errors.md) chapter) and "Execution Details".

> [!WARNING]
>
> Starting with the new Australia release, newly provisioned ServiceNow development instances **block direct API/REST connections** by default. This results in a "401 Unauthorized" error due to updated security settings. Before connecting any tools or scripts, assign the `snc_basic_auth_api_access` role to your user account (default admin) once. Once this role is added to your user account, you are all set and won't need to do it again for that instance (unless a new instance is requested). Necessary steps are:
>
> * Select `Users`.
> * Search for your username (default admin) and select it.
>
> ![ServiceNow: Configuration](https://mintcdn.com/qbilon-docs/aJQhbcvq7mtvhV0w/.gitbook/assets/0cd7e5ce-64b0-41dd-8878-1549c1419a91-sn-auth-1.png?fit=max\&auto=format\&n=aJQhbcvq7mtvhV0w\&q=85\&s=274305510bbd8a0f9a16b8bd1800c646)
>
> * Select the `Edit...` button above the roles table:
>
> ![ServiceNow: Configuration](https://mintcdn.com/qbilon-docs/lr-P4KF_9wn8x9Vs/.gitbook/assets/c55dad34-61b7-40d0-b37e-3a26cfabde1c-sn-auth-2.png?fit=max\&auto=format\&n=lr-P4KF_9wn8x9Vs\&q=85\&s=75185664e5c437bb131cc1c2b71158cb)
>
> * Search for the role and add it to the roles list by clicking"`>`" and `save`.
>
> ![ServiceNow: Configuration](https://mintcdn.com/qbilon-docs/Jmla3tEw4FRYjkNT/.gitbook/assets/b8ae46d9-d60d-485f-9e1b-0c5555b27415-sn-auth-3.png?fit=max\&auto=format\&n=Jmla3tEw4FRYjkNT\&q=85\&s=b59e7a6277bf235e4d54f32357386741)
>
> * Your account now has the role using the basic auth authentication method used by Qbilon.

## Custom Tables Definition

In addition to the predefined tables in `Services`, you can create your own tables. You can also import custom tables you've created into Qbilon.

There are two main advantages to using `Custom Tables` instead of predefined services.

* You can define an optional query to limit the ServiceNow assets imported into Qbilon to only the ones you are interested in. This reduces loading time and the amount of asset quota used in Qbilon.
* References (not relations) between assets of those tables are automatically resolved and imported into Qbilon.

To define one or more custom tables, adhere to the following syntax in the input field:
`<technical table name><(optional query)>:<type name in Qbilon>` (multiple tables must be separated via a comma).

* **technical table name**: can be seen in the Class Manager of ServiceNow, usually similar to `cmdb_ci_abc`

* **optional query**: can be skipped, but if used has to be a ServiceNow query that can be retrieved from the query editor in ServiceNow:

  <video controls aria-label="ServiceNow query editor recording" src="https://mintcdn.com/qbilon-docs/Jmla3tEw4FRYjkNT/.gitbook/assets/7a72e6ff-638a-4dee-9486-a20ad3daf800-screen-recording-2025-12-17-11-52.webm?fit=max&auto=format&n=Jmla3tEw4FRYjkNT&q=85&s=8409a182d63f6ecab789c228b317fb48" />

  the value would look like this: `nameSTARTSWITHiron`.

* **type name in Qbilon**: This name can be chosen freely, e.g., "My Application"

Here are some examples of this type of definition:

* All "Applications": `cmdb_ci_appl:ServiceNow Application`
* "Applications" that fulfill multiple criteria: `cmdb_ci_appl(nameSTARTSWITHiron^nameLIKESD)`
* "Applications" that contain "iron" in their name together with "Clusters": `cmdb_ci_appl(nameLIKEiron):Application,cmdb_ci_cluster:Cluster`

## Dynamic Relationship Loading

Relationships between tables are loaded dynamically. Qbilon automatically fetches all relationships between the `Custom Tables` you have specified. If there is a relationship between records in "Table A" and "Table B", Qbilon creates a relation with the correct relationship type.

This process fully supports inheritance. When you configure a parent table (e.g., "Table Y") for loading, Qbilon automatically retrieves the relationships for all records in its child tables (e.g., Table X).

Please note that relationships are only loaded if they occur between the `Custom Tables` defined in your configuration.

## Troubleshooting

If the ServiceNow connector encounters an error, the "Status" chip will turn red.

Clicking on the "info icon" in the "Actions" button bar next to the data source provides further information, such as:

* `Unauthorized: Authentication failed` if the credentials provided are incorrect,
* `Service Unavailable` if the specified host is unavailable or
* `Bad Request: [...] status code "400" [...] invalid table` if an optionally provided "ServiceNow Custom Table" cannot be found.

![ServiceNow: Troubleshooting](https://mintcdn.com/qbilon-docs/Jmla3tEw4FRYjkNT/.gitbook/assets/9ca20da4-d560-431d-941b-35c01bfed5d1-image.png?fit=max\&auto=format\&n=Jmla3tEw4FRYjkNT\&q=85\&s=fe1c71e3ecd0bd01a16b2fd55c18091f)

Failing connection to an internal data source due to incorrect credentials.

In case the provided ServiceNow user only lacks permissions to access the required tables, the connector's status will be "activated" (green), but the log will contain a yellow `Warning: Forbidden` message as shown in Figure 2.

![ServiceNow: Troubleshooting](https://mintcdn.com/qbilon-docs/aJQhbcvq7mtvhV0w/.gitbook/assets/53c565ec-3e8d-45f9-8604-ee98e1ff112d-image.png?fit=max\&auto=format\&n=aJQhbcvq7mtvhV0w\&q=85\&s=d018ba5c6002f8edbfcb11b21ec1baa0)

Table access denied due to insufficient user privileges.


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