<a id="cc-servicenow-source-v2"></a>

# ServiceNow Source V2 Connector for Confluent Cloud

The fully managed ServiceNow Source V2 connector for Confluent Cloud polls data from the specified [ServiceNow tables](https://www.servicenow.com/docs/de-DE/bundle/xanadu-platform-administration/page/administer/table-administration/concept/c_TableAdministration.html)
into Apache Kafka® in real time. The connector supports Avro, JSON Schema,
and Protobuf data output formats for Kafka topics. The connector consumes data from up to five
ServiceNow tables to add records in Kafka topics.

If you require private networking for fully managed connectors, make sure to set up the proper
networking beforehand. For more information, see [Manage Networking for Confluent Cloud Connectors](networking/internet-resource.md#clusters-connect-cloud).

## Features

The ServiceNow Source V2 connector includes the following features:

* **Topics created automatically**: The connector can automatically create Kafka topics.
* **Secure access and data exchange**: The connector supports the following
  authentication mechanisms:
  - Basic
  - OAuth2 client credentials
* **API error reporting management**: You can configure the connector to notify
  you when an API error occurs through email or the Confluent Cloud Console. You can
  also configure the connector to ignore when an API error occurs.
* **Supported data formats**: The connector supports Avro, JSON Schema,
  and Protobuf data formats. [Schema Registry](../get-started/schema-registry.md#cloud-sr-config) must be enabled to use a Schema Registry-based format.
* **At least once delivery**: The connector guarantees that records are delivered
  at least once to the Kafka topic.
* **Multiple tables support**: The connector allows you to fetch records from up to
  five tables simultaneously. This is supported with multiple tasks also.
* **Elasticity**: The connector allows you to configure two parameters that enforce the
  throughput limit: `table{{i}}.batch.size` and `table{{i}}.request.interval.ms`.
  The connector defaults to `20000` records and a `2000` milliseconds polling interval.
  If a large number of updates occur within the given interval, the connector will paginate
  records according to configurable batch size. Note that because ServiceNow provides precision
  to one second, the ServiceNow V2 connector sets `2000` milliseconds as the
  lowest `table{{i}}.request.interval.ms` configuration property setting.
* **Schema registry and schema context support**: The connector allows you to
  map an API to a specific schema context so that you can use the schema
  context feature in different environments.
* **Custom offset support**: The connector allows you to configure [custom
  offsets](offsets.md#connect-custom-offsets) using the Confluent Cloud Console to prevent
  data loss and data duplication.
* **Configurable retry functionality**: The connector allows you to customize
  retry settings based on your requirements.
* **New configuration support**: The connector supports the following new property configurations:
  - Specify initial timestamps up to granularity of seconds.
  - Specify `table{{i}}.pagination.query` (equivalent to `sysparm_query`) to allow an
    [encoded query](https://www.servicenow.com/docs/csh?topicname=c_EncodedQueryStrings&version=xanadu&pubname=xanadu-platform-user-interface)
    to filter the result set. For pagination, use either `sys_updated_on` or `sys_created_on`.
  - Specify `table{{i}}.display.value` (equivalent to `sysparm_display_value`) to determine the type of data returned, either the actual
    values from the database or the display values of the fields.
  - Use `table{{i}}.allowlisted.fields` (equivalent to `sysparm_fields`) to specify the desired list (comma-separated) of fields from the table
    record for ingestion in Kafka.

  For more information about new properties, see [ServiceNow Table API](https://www.servicenow.com/docs/de-DE/bundle/xanadu-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html).
* **Client-side encryption (CSFLE and CSPE) support**: The connector supports CSFLE and CSPE for sensitive data.
  For more information about CSFLE or CSPE setup,
  see [connector configuration](cc-servicenow-source.md#cc-servicenow-source-setup-connection).

For more information and examples to use with the Confluent Cloud API for Connect,
see the [Confluent Cloud API for Connect Usage Examples](connect-api-section.md#ccloud-connect-api) section.

## Limitations

Be sure to review the following information:

* For connector limitations, see [ServiceNow Source V2 Connector](limits.md#cc-servicenow-source-v2-limits) limitations.
* If you plan to use one or more Single Message Transformations (SMTs), see [SMT Limitations](single-message-transforms.md#cc-single-message-transforms-limitations).

<a id="cc-servicenow-source-v2-custom-offsets"></a>

## Manage custom offsets

You can manage the offsets for this connector. Offsets provide information on the
point in the system from which the connector is accessing data. For more
information, see [Manage Offsets for Fully Managed Connectors in Confluent Cloud](offsets.md#connect-custom-offsets).

**To manage offsets**:

- Manage offsets using Confluent Cloud APIs. For more information, see [Connect offsets API reference](https://docs.confluent.io/cloud/current/ccloud/offsets-connect-v-1/).

### Get the current offset

To get the current offset, make a `GET` request that specifies the environment, Kafka cluster, and connector name.

```bash
GET /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectors/{connector_name}/offsets
Host: https://api.confluent.cloud
```

**Response:**

Successful calls return HTTP `200` with a JSON payload that describes the offset.

```bash
{
    "id": "lcc-example123",
    "name": "{connector_name}",
     "offsets": [
        {
           "partition": {
              "url": "https://<servicenow-instance>.service-now.com/api/now/table/incident"
           },
           "offset": {
              "offset": "2024-12-16 14:25:58",
              "operator": "=",
              "primary_key": "ee3fb4c9c3ea12100127x"
           }
        }
     ],
    "metadata": {
        "observed_at": "2024-03-28T17:57:48.139635200Z"
    }
}
```

Responses include the following information:

- The position of the latest offset.
- The observed time of the offset in the metadata portion of the payload. The `observed_at` time
  indicates a snapshot in time for when the API retrieved the offset. A running connector continuously updates
  its offsets. Use `observed_at` to get a sense of the gap between real time and the time at which the request
  was made. By default, offsets are observed every minute. Calling `GET` repeatedly will fetch more recently
  observed offsets.
- Information about the connector.

### Update the offset

To update the offset, make a `POST` request that specifies the environment, Kafka cluster, and connector
name. Include a JSON payload that specifies new offset and a patch type.

```bash
POST /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectors/{connector_name}/offsets/request
Host: https://api.confluent.cloud

 {
     "type": "PATCH",
      "offsets": [
         {
            "partition": {
               "url": "https://<servicenow-instance>.service-now.com/api/now/table/incident"
            },
            "offset": {
               "offset": "2024-12-16 14:25:58",
               "operator": ">=",
               "primary_key": ""
            }
         }
      ]
 }
```

Considerations:

- You can only make one offset change at a time for a given connector.
- This is an asynchronous request. To check the status of this request, you must use
  the check offset status API. For more information, see **Get the status of an offset request** tab.
- For source connectors, the connector attempts to read from the position defined by the requested offsets.

**Response:**

Successful calls return HTTP `202 Accepted` with a JSON payload that describes the offset.

```bash
{
    "id": "lcc-example123",
    "name": "{connector_name}",
    "offsets": [
       {
          "partition": {
             "url": "https://<servicenow-instance>.service-now.com/api/now/table/incident"
          },
          "offset": {
             "offset": "2024-12-16 14:25:58",
             "operator": ">=",
             "primary_key": ""
          }
       }
    ]
    "requested_at": "2024-03-28T17:58:45.606796307Z",
    "type": "PATCH"
}
```

Responses include the following information:

- The requested position of the offsets in the source.
- The time of the request to update the offset.
- Information about the connector.

### Delete the offset

To delete the offset, make a `POST` request that specifies the environment, Kafka cluster, and connector
name. Include a JSON payload that specifies the delete type.

```bash
 POST /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectors/{connector_name}/offsets/request
 Host: https://api.confluent.cloud

{
  "type": "DELETE"
}
```

Considerations:

- A delete request removes the offset for the specified partition and resets it to the base state. A
  delete request is as if you created a fresh new connector.
- This is an asynchronous request. To check the status of this request, you must use the check
  offset status API. For more information, see **Get the status of an offset request** tab.
- Do not issue delete and patch requests at the same time.
- For source connectors, the connector attempts to read from the position defined in the base state.

**Response**:

Successful calls return HTTP `202 Accepted` with a JSON payload that describes the result.

```bash
{
  "id": "lcc-example123",
  "name": "{connector_name}",
  "offsets": [],
  "requested_at": "2024-03-28T17:59:45.606796307Z",
  "type": "DELETE"
}
```

Responses include the following information:

- Empty offsets.
- The time of the request to delete the offset.
- Information about Kafka cluster and connector.
- The type of request.

### Get the status of an offset request

To get the status of a previous offset request, make a `GET` request that specifies the environment, Kafka cluster, and connector
name.

```bash
GET /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectors/{connector_name}/offsets/request/status
Host: https://api.confluent.cloud
```

Considerations:

- The status endpoint always shows the status of the most recent PATCH/DELETE operation.

**Response**:

Successful calls return HTTP `200` with a JSON payload that describes the result. The following is an example
of an applied patch.

```bash
{
   "request": {
      "id": "lcc-example123",
      "name": "{connector_name}",
      "offsets": [
         {
            "partition": {
               "url": "https://<servicenow-instance>.service-now.com/api/now/table/incident"
            },
            "offset": {
               "offset": "2024-12-16 14:25:58",
               "operator": "=",
               "primary_key": "ee3fb4c9c3ea12100127x"
            }
         }
      ],
      "requested_at": "2024-03-28T17:58:45.606796307Z",
      "type": "PATCH"
   },
   "status": {
      "phase": "APPLIED",
      "message": "The Connect framework-managed offsets for this connector have been altered successfully. However, if this connector manages offsets externally, they will need to be manually altered in the system that the connector uses."
   },
   "previous_offsets": [
      {
         "partition": {
            "url": "https://<servicenow-instance>.service-now.com/api/now/table/incident"
         },
         "offset": {
            "offset": "2024-12-15 14:25:58",
            "operator": "=",
            "primary_key": "abcbee3fb4c9c3ea12100127x"
         }
      }
   ],
   "applied_at": "2024-03-28T17:58:48.079141883Z"
}
```

Responses include the following information:

- The original request, including the time it was made.
- The status of the request: applied, pending, or failed.
- The time the status request was issued.
- The previous offsets. These are the offsets that the connector last updated
  prior to updating the offsets. Use these to try to restore the state of your connector
  if a patch update causes your connector to fail or to return a connector to its
  previous state after rolling back.

### JSON payload

The table below provides a description of the unique fields in the JSON payload for managing offsets of
the ServiceNow Source V2 connector.

| Field         | Definition                                                               | Required/Optional   |
|---------------|--------------------------------------------------------------------------|---------------------|
| `url`         | Combination of the ServiceNow base URL and the table API path.           | Required            |
| `offset`      | Timestamp (`yyyy-MM-dd HH:mm:ss`) is used as the offset for all records. | Required            |
| `operator`    | Always set to `>=`                                                       | Required            |
| `primary_key` | Always set as empty string - `""`                                        | Required            |

## Quick Start

Use this quick start to get up and running with the ServiceNow Source V2 connector on Confluent Cloud
connector.

<a id="cc-servicenow-source-v2-prereqs"></a>

### Prerequisites

- Authorized access to a [Confluent Cloud](https://www.confluent.io/confluent-cloud/) cluster on Amazon Web Services
  (AWS), Microsoft Azure (Azure), or Google Cloud).
- The Confluent CLI installed and configured for the cluster. For more information, see
  [Install the Confluent CLI](https://docs.confluent.io/confluent-cli/current/install.html).
- [Schema Registry](../get-started/schema-registry.md#cloud-sr-config) must be enabled to use a
  Schema Registry-based format (for example, Avro, JSON_SR (JSON Schema), or Protobuf).
- You must have the ServiceNow instance URL, table name, and connector authentication details.
  For more information, see [ServiceNow User Administration](https://docs.servicenow.com/bundle/rome-platform-administration/page/administer/roles/concept/c_UserAdministration.html) documentation.

### Using the Confluent Cloud Console

#### Step 1: Launch your Confluent Cloud cluster

To create and launch a Kafka cluster in Confluent Cloud, see [Create a kafka cluster in Confluent Cloud](../get-started/index.md#cloud-create-kafka-cluster).

#### Step 2: Add a connector

In the left navigation menu, click **Connectors**. If you already have connectors in your cluster, click **+ Add
connector**.

#### Step 3: Select your connector

Click the **ServiceNow Source V2** connector card.

![ServiceNow Source V2 Connector Card](images/ccloud-servicenow-source-v2-icon.png)

<a id="cc-servicenow-source-v2-connection"></a>

#### Step 4: Enter the connector details

#### NOTE
* Ensure you have all your [prerequisites](#cc-servicenow-source-v2-prereqs) completed.
* An asterisk ( \* ) designates a required entry.

At the **Add ServiceNow Source V2 Connector** screen, complete the following:

### Kafka access

1. Select the way you want to provide **Kafka Cluster credentials**. You can
   choose one of the following options:
   - **My account**: This setting allows your connector to globally access everything
     that you have access to. With a user account, the connector uses an API key and
     secret to access the Kafka cluster. This option is not recommended for production.
   - **Service account**: This setting limits the access for your connector by using a
     [service account](service-account.md#s3-cloud-service-account). This option is recommended for
     production.
   - **Use an existing API key**: This setting allows you to specify an API key and a
     secret pair. You can use an existing pair or create a new one. This method is not
     recommended for production environments.

   #### NOTE
   Freight clusters support only service accounts for Kafka authentication.
2. Click **Continue**.

### Authentication

1. Configure the authentication properties:

   **Authentication**
   - **ServiceNow Instance URL**: Enter your HTTP API based ServiceNow base URL.
     For example: `https://<servicenow-instance>.service-now.com`.
   - **Endpoint Authentication Type**: The supported authentication types of the endpoint. Valid options are Basic and OAuth2 client credentials.
   - **Auth Username**: The username for an endpoint requiring basic authentication.
   - **Auth Password**: The password for an endpoint that requires basic authentication.
   - **OAuth2 Token URL**: The URL for fetching the OAuth2 token. The supported grant type is Client Credentials.
   - **OAuth2 Client ID**: The client ID for fetching the OAuth2 token.
   - **OAuth2 Client Secret**: The client secret for fetching the OAuth2 token.
   - **OAuth2 Token Property Name**: The name of the property that contains the OAuth2 token returned by the OAuth2 token URL (defaults to `access_token`).
   - **OAuth2 Client Scope**: The scope parameter sent to the service when fetching the OAuth2 token.
   - **OAuth2 Client Mode**: The encoding method of the `client_id` and `client_secret` in an OAuth2 authorization request. If set to `header`, the credentials are encoded as an `Authorization: Basic <base-64 encoded client_id:client_secret>` HTTP header. If set to `url`, the credentials are sent as URL-encoded parameters.
   - **OAuth2 Client Headers**: The HTTP headers that should be included in the OAuth2 client endpoint. Individual headers must be separated by a |.
   - **SSL Enabled**: Defaults to false. If you set this property to true, you must upload
     the Key Store and/or Trust Store files. You must also supply the required
     passwords for each uploaded file.
   - **Key Store**: The keystore that contains the client certificate and private key. Supported formats are JKS or PKCS12. File system paths are not supported.
   - **Keystore Password**: The store password for the key store file.
   - **Key Password**: The password for the private key in the key store file.
   - **Trust Store**: The truststore that contains the server CA certificate(s). Supported formats are JKS or PKCS12. File system paths are not supported.
   - **Trust Store Password**: The trust store password that contains a server CA certificate.
   - **SSL Protocol**: The protocol to use for SSL connections.
2. Click **Continue**.

### Configuration

**Output messages**

- **Select output record value format**: Select the output Kafka record value format (data going to the
  Kafka topic). Valid values are AVRO, JSON_SR, or PROTOBUF. [Schema Registry](../get-started/schema-registry.md#cloud-sr-config) must be enabled
  to use a Schema Registry-based format (for example, Avro, JSON Schema, or Protobuf).

**Tables**

- **Number of tables**: The number of tables to fetch data from. This value should be less than or equal to 5.

**Table - 1 configurations**

- **Table**: The table name, which when combined with the ServiceNow Instance URL, forms the complete HTTP(S) URL. This path can be templated to include offset information.
- **Topic**: Specifies the topic to which data is pushed for this table.
- **Batch Size**: The size of the batch of records to fetch from the ServiceNow table. Note that Basic and Standard Clusters may experience throughput limitations, even with a higher batch size.
- **Start Time in UTC (yyyy-MM-dd HH:mm:ss)**: The time to start fetching all updates/creation. Defaults to 1970-01-01 00:00:00. Note that the time is in UTC and requires the format: yyyy-MM-dd HH:mm:ss.
- **Timestamp Field**: The timestamp field to use for pagination.
- **Pagination Query**: The query to use for pagination on the table, which can be templated with offset information (`${offset}`). Note that all other table-related configurations are ignored if this is configured. It defaults to a timestamp-based pagination query. An example query is `closed_at>=${offset}^ORDERBYclosed_at`, where `${offset}` refers to the pagination query offset field (`closed_at`).
- **Pagination Query Field**: The offset field if pagination query is used.
- **Request parameters separator**: Specifies the character used to separate ServiceNow query parameters. This character must not appear in the pagination query. The default value is `&`. If your pagination query contains `&`, specify a different separator, such as `|`. Do not use `=`.
- **Display Values**: Specifies whether to display values for the ServiceNow table records.
- **Allowlisted Fields**: A comma-separated list of fields that should be included in the Kafka record. The list must include the selected timestamp field (either `sys_updated_on` or `sys_created_on`) and the `sys_id` field. It defaults to all fields from the response.
- **Request Interval ms**: The time in milliseconds to wait between consecutive requests.
- **Exclude Reference Links**: Specifies whether to exclude Table API links for reference fields. By default, all Table API links are included.
- **Query Category**: The name of the category to use for queries.
- **Count Records**: Specifies whether a `SELECT COUNT(*)` query runs to retrieve the row count on the table. Setting it to true enables this query.
- **Query Domain**: Specifies whether to restrict the record search to the domains that are accessible to the logged in user. If set to true, it excludes the records from domains that the current logged in user can’t access.
- **Suppress Pagination Header**: Specifies whether to remove the Link header from the response. The Link header provides various URLs to relative pages in the record set which you can use to paginate the returned record set.

**Data encryption**

- Enable **Client-Side Field Level Encryption**
  for data encryption. Specify a **Service Account** to
  access the Schema Registry and associated encryption rules or keys with that schema. For more
  information on CSFLE or CSPE setup,
  see [Manage encryption for connectors](csfle.md#connect-csfle).

### **Show advanced configurations**

- **Reporter Error Topic Name**: The name of the topic to produce errant records after each unsuccessful API operation. Defaults to ‘error-${connector}’ if not set. You can provide `${connector}` in the value to use it as a placeholder for the logical cluster ID.
- **Schema context**: Select a schema context to use for this connector, if using
  a schema-based data format. This property defaults to the **Default** context,
  which configures the connector to use the default schema set up for Schema Registry in your
  Confluent Cloud environment. A schema context allows you to use separate schemas (like
  schema sub-registries) tied to topics in different Kafka clusters that share the
  same Schema Registry environment. For example, if you select a non-default context, a
  **Source** connector uses only that schema context to register a schema and a
  **Sink** connector uses only that schema context to read from. For more
  information about setting up a schema context, see [What are schema contexts and when should you use them?](../sr/faqs-cc.md#faq-schema-contexts).

**Additional Configs**

- **Value Converter Reference Subject Name Strategy**: Sets the subject reference name strategy for values. Valid entries are `DefaultReferenceSubjectNameStrategy` or `QualifiedReferenceSubjectNameStrategy`. You can use this strategy only with `PROTOBUF` format; the default strategy is `DefaultReferenceSubjectNameStrategy`.
- **Errors Tolerance**: Use this property to configure the connector’s error handling behavior.

  #### WARNING
  Use this property with caution for sink connectors, as it can lead to data loss. If you set this property to `all`, the connector does not fail on errant records, but logs them (and sends to DLQ for sink connectors) and continues processing. If you set this property to `none`, the connector task fails on errant records.
- **Value Converter Ignore Default For Nullables**: When set to `true`, this property ensures that the corresponding record in Kafka is `null`, instead of showing the default column value. Applies to the `AVRO`, `PROTOBUF`, and `JSON_SR` converters.
- **Value Converter Decimal Format**: Specifies the `JSON` or `JSON_SR` serialization format for Connect `DECIMAL` logical type values with two allowed literals:
  `BASE64` to serialize `DECIMAL` logical types as base64 encoded binary data, and
  `NUMERIC` to serialize `DECIMAL` logical type values in `JSON` or `JSON_SR` as a number representing the decimal value.
- **Key Converter Schema ID Serializer**: The class name of the schema ID serializer for keys. This is used to serialize schema IDs in the message headers.
- **Value Converter Connect Meta Data**: Enables the Connect converter to add its metadata to the output schema. Applies to Avro converters.
- **Value Converter Value Subject Name Strategy**: Determines how to construct the subject name under which the value schema is registered with Schema Registry.
- **Key Converter Key Subject Name Strategy**: Determines how to construct the subject name for key schema registration.
- **Value Converter Schema ID Serializer**: The class name of the schema ID serializer for values. This is used to serialize schema IDs in the message headers.

**Auto-restart policy**

- **Enable Connector Auto-restart**: Enables the auto-restart behavior of the connector and its
  task in the event of user-actionable errors. Defaults to `true`, enabling the connector to
  automatically restart in case of user-actionable errors. Set this property to `false` to
  disable auto-restart for failed connectors. If disabled, you must manually restart the connector.

**Behavior on error**

- **Behavior On Errors**: Select the error handling behavior
  setting for handling error responses from HTTP requests. Valid options
  are `IGNORE` and `FAIL`. This defaults to `IGNORE`.

**Retry configurations**

- **Retry Backoff Policy**: The backoff policy to use in terms of a
  retry. Valid options are `CONSTANT_VALUE` OR `EXPONENTIAL_WITH_JITTER`.
- **Retry Backoff (ms)**: The time in milliseconds to wait after
  an error before the connector retries the task.
- **Retry HTTP Status Codes**: The HTTP response status codes
  that prompt the connector to retry the request. Enter a
  comma-separated list of codes or range of codes. Ranges are
  specified with a start and optional end code. Range boundaries are
  inclusive. For example: `400-` includes all codes greater than
  or equal to 400 and `400-500` includes codes from 400 to
  500, including 500. Multiple ranges and single codes can be
  specified together to achieve fine-grained control over retry
  behavior. For example: `404,408,500-` prompts the connector to
  retry on `404 NOT FOUND`, `408 REQUEST TIMEOUT`, and all
  `5xx` error codes. Note that some status codes are always
  retried, such as unauthorized, timeouts, and too many requests.
- **Maximum Retries**: The maximum number of times the connector
  retries a request when an error occurs before the task fails.

**Transforms**

- **Single Message Transformations**: To add a new SMT, see [Add transforms](single-message-transforms.md#cc-single-message-transforms-ui).
  For more information about unsupported SMTs, see
  [Unsupported transformations](single-message-transforms.md#cc-single-message-transforms-unsupported-transforms).

**Processing position**

- **Set offsets**: Click **Set offsets** to define a specific offset for
  this connector to begin procession data from. For more information
  on managing offsets, see [Manage offsets](offsets.md#connect-custom-offsets).

For all property values and definitions, see [Configuration Properties](#cc-servicenow-source-v2-config-properties).

- Click **Continue**.

### Sizing

Based on the number of topic partitions you select, you will be provided
with a recommended number of tasks.

1. To change the number of recommended tasks, enter the number of
   [tasks](/platform/current/connect/concepts.html#tasks) for the connector to use
   in the **Tasks** field.
2. Click **Continue**.

### Review and Launch

1. Verify the connection details.
2. Click **Continue**.

   The status for the connector should go from **Provisioning** to
   **Running**.

#### Step 5: Check for records

Verify that records are being produced at the Kafka topic.

For more information and examples to use with the Confluent Cloud API for Connect,
see the [Confluent Cloud API for Connect Usage Examples](connect-api-section.md#ccloud-connect-api) section.

### Using the Confluent CLI

To set up and run the connector using the Confluent CLI, complete the
following steps, but ensure you have met all [prerequisites](#cc-servicenow-source-v2-prereqs).

#### Step 1: List the available connectors

Enter the following command to list available connectors:

```none
confluent connect plugin list
```

#### Step 2: List the connector configuration properties

Enter the following command to show the connector configuration properties:

```none
confluent connect plugin describe <connector-plugin-name>
```

The command output shows the required and optional configuration properties.

<a id="cc-servicenow-source-v2-cli-configuration-file"></a>

#### Step 3: Create the connector configuration file

Create a JSON file that contains the connector configuration properties. The
following example shows the required connector properties.

```json
{
  "connector.class": "ServiceNowSourceV2",
  "name": "ServiceNowSourceV2Connector_1",
  "kafka.auth.mode": "KAFKA_API_KEY",
  "kafka.api.key": "****************",
  "kafka.api.secret": "************************************************",
  "output.data.format": "JSON_SR",
  "tasks.max": "1",
  "servicenow.url": "https://instance.service-now.com",
  "auth.type": "BASIC",
  "connection.user": "admin",
  "connection.password": "************",
  "tables.num": "2",
  "table1.name": "incident",
  "table1.topic": "topic-1",
  "table1.batch.size": "20000",
  "table1.start.timestamp": "1970-01-01 00:00:00",
  "table1.timestamp.field": "sys_updated_on",
  "table1.display.value": "false",
  "table1.request.interval.ms": "2000",
  "table2.name": "perf_test",
  "table2.topic": "topic-2",
  "table2.batch.size": "20000",
  "table2.start.timestamp": "1970-01-01 00:00:00",
  "table2.timestamp.field": "sys_updated_on",
  "table2.display.value": "false",
  "table2.request.interval.ms": "2000"
}
```

Note the following property definitions:

* `"connector.class"`: Identifies the connector plugin name.
* “`output.data.format"`: Enter an output data format (data going to the Kafka
  topic): AVRO, JSON_SR (JSON Schema), or PROTOBUF.
  [Schema Registry](../get-started/schema-registry.md#cloud-sr-config) must be enabled to use a Schema Registry-based
  format (for example, Avro, JSON_SR (JSON Schema), or Protobuf).

* `"kafka.auth.mode"`: Identifies the connector authentication mode you want to use. There are two options: `SERVICE_ACCOUNT` or `KAFKA_API_KEY` (the default). To use an API key and secret, specify the configuration properties `kafka.api.key` and `kafka.api.secret`, as shown in the example configuration (above).  To use a [service account](service-account.md#s3-cloud-service-account), specify the **Resource ID** in the property `kafka.service.account.id=<service-account-resource-ID>`. To list the available service account resource IDs, use the following command:
  ```bash
  confluent iam service-account list
  ```

  For example:
  ```bash
  confluent iam service-account list

     Id     | Resource ID |       Name        |    Description
  +---------+-------------+-------------------+-------------------
     123456 | sa-l1r23m   | sa-1              | Service account 1
     789101 | sa-l4d56p   | sa-2              | Service account 2
  ```

* `"name"`: Sets a name for your new connector.
* `"table<i>.topic"`: Enter the topic name where data is sent.
* `"tasks.max"`: Enter the maximum number of
  [tasks](/platform/current/connect/index.html#tasks) for the connector to use. More
  tasks might improve performance.

  #### NOTE
  The maximum number of tasks should be less than or equal to the number of tables configured.
* `"tables.num"`: Specify the number of tables to poll the data from. Note that this value should be less than or equal to 5.
  Configure the number of tables you set in the `tables.num` field. For example, if you entered 2 in the `tables.num` field,
  you should set 2 table configurations as shown in the connector properties example above.
  For more information about table properties and values, see [Configuration Properties](#cc-servicenow-source-v2-config-properties).

#### NOTE
To enable CSFLE or CSPE for data encryption, specify the following properties:

* `csfle.enabled`: Flag to indicate whether the connector honors CSFLE or CSPE rules.
* `sr.service.account.id`: A Service Account to access the Schema Registry and associated encryption rules or keys with that schema.

For more information on CSFLE or CSPE setup, see [Manage encryption for connectors](csfle.md#connect-csfle).

**SMTs**: For details about adding SMTs using the Confluent CLI, see
the [Single Message Transformations](single-message-transforms.md#cc-single-message-transforms)
documentation. For all property values and descriptions, see
[Configuration Properties](#cc-servicenow-source-v2-config-properties).

#### Step 4: Load the properties file and create the connector

To load the configuration and start the connector, run the following Confluent CLI command:

```none
confluent connect cluster create --config-file <file-name>.json
```

For example:

```none
confluent connect cluster create --config-file servicenow-source-v2-config.json
```

Example output:

```none
Created connector ServiceNowSourceV2Connector_0 lcc-do6vzd
```

#### Step 5: Check the connector status.

To check the connector status, run the following Confluent CLI command:

```none
confluent connect cluster list
```

Example output:

```none
ID           |             Name                           | Status  | Type | Trace |
+------------+--------------------------------------------+---------+------+-------+
lcc-do6vzd   | ServiceNowSourceV2Connector_0    | RUNNING | sink |       |
```

#### Step 6: Check for records

Verify that records are populating the endpoint.

For more information and examples to use with the Confluent Cloud API for Connect,
see the [Confluent Cloud API for Connect Usage Examples](connect-api-section.md#ccloud-connect-api) section.

<a id="cc-servicenow-source-v2-migration"></a>

## Moving from V1 to V2

Use one of the following options to migrate to ServiceNow Source V2 connector. Implement and validate any
connector changes in a pre-production environment before promoting to
production.

### Migration option 1

1. Pause the ServiceNow Source V1 connector.
2. Note the timestamp of the last sourced record.
3. Create a ServiceNow Source V2 connector to fetch all records that were created or
   updated from that specific point in time by configuring `table1.start.timestamp`
   and `table1.timestamp.field` (to `sys_updated_on`) properties.
4. Verify the records and confirm that the V2 connector
   is running successfully with the fetched records.
5. [Delete](https://docs.confluent.io/cloud/current/ccloud/delete-connectv-1-connector/)
   the V1 connector.

### Migration option 2

1. Pause the ServiceNow Source V1 connector.
2. Get the [offset](https://docs.confluent.io/cloud/current/ccloud/get-connectv-1-connector-offsets/) for the V1 connector.
3. Create a ServiceNow Source V2 connector using the offset from the previous step.
   ```none
   confluent connect cluster create [flags]
   ```

   For example:

   Create a configuration file with connector configs and offsets.
   ```none
   {
     "name": "(connector-name)",
     "config": {
         ... // connector specific configuration
     },
     "offsets": [
         {
             "partition": {
         ... // connector specific configuration
             },
             "offset": {
         ... // connector specific configuration
             }
         }
     ]
   }
   ```

   Create a V2 connector in the current or specified Kafka cluster context.
   ```none
   confluent connect cluster create --config-file config.json
   ```

   #### NOTE
   The configuration payload differs between V1 and V2 connectors. In the V2 connector,
   the value field contains only the value of the key-value pair and does not include the key,
   topic, partition, and offset. Make necessary changes in the V2 connector to match the
   configurations from the V1 connector.
4. Verify the migration and confirm that the V2 connector is running successfully with the V1 payloads.
5. Set `table1.start.timestamp` and `table1.timestamp.field` to fetch all records that were created or
   updated from a specific point in time.
6. [Delete](https://docs.confluent.io/cloud/current/ccloud/delete-connectv-1-connector/) the V1 connector.

For more information, see [Manage Offsets for Fully Managed Connectors in Confluent Cloud](offsets.md#connect-custom-offsets).

<a id="cc-servicenow-source-v2-config-properties"></a>

## Configuration Properties

Use the following configuration properties with the fully managed ServiceNow Source V2
connector. The connector allows you to fetch records from up to five tables simultaneously.
For example, if you enter 2 in the `tables.num` field, you should configure two tables
using the **Table-1 configurations** section. For more information,
see [sample JSON file](#cc-servicenow-source-v2-cli-configuration-file) containing the
table configuration properties.

### How should we connect to your data?

`name`
: Sets a name for your connector.
  <br/>
  * Type: string
  * Valid Values: A string at most 64 characters long
  * Importance: high

### Kafka Cluster credentials

`kafka.auth.mode`
: Kafka Authentication mode. It can be one of KAFKA_API_KEY or SERVICE_ACCOUNT. It defaults to KAFKA_API_KEY mode, whenever possible.
  <br/>
  * Type: string
  * Valid Values: SERVICE_ACCOUNT, KAFKA_API_KEY
  * Importance: high

`kafka.api.key`
: Kafka API Key. Required when kafka.auth.mode==KAFKA_API_KEY.
  <br/>
  * Type: password
  * Importance: high

`kafka.service.account.id`
: The Service Account that will be used to generate the API keys to communicate with Kafka Cluster.
  <br/>
  * Type: string
  * Importance: high

`kafka.api.secret`
: Secret associated with Kafka API key. Required when kafka.auth.mode==KAFKA_API_KEY.
  <br/>
  * Type: password
  * Importance: high

### Schema Config

`schema.context.name`
: Add a schema context name. A schema context represents an independent scope in Schema Registry. It is a separate sub-schema tied to topics in different Kafka clusters that share the same Schema Registry instance. If not used, the connector uses the default schema configured for Schema Registry in your Confluent Cloud environment.
  <br/>
  * Type: string
  * Default: default
  * Importance: medium

### Output messages

`output.data.format`
: Output Kafka record value format. Valid entries are `AVRO`, `JSON_SR`, or `PROTOBUF`. Ensure you configure the Confluent Cloud Schema Registry for such schema-based message formats.
  <br/>
  * Type: string
  * Default: JSON_SR
  * Importance: high

### Number of tasks for this connector

`tasks.max`
: Maximum number of tasks for the connector.
  <br/>
  * Type: int
  * Valid Values: [1,…]
  * Importance: high

### Behavior on error

`behavior.on.error`
: The error handling behavior setting for handling error response from HTTP requests. Valid values are FAIL or IGNORE.
  <br/>
  * Type: string
  * Default: FAIL
  * Importance: low

### Authentication

`servicenow.url`
: ServiceNow instance URL. For example: https://${instance-id}.service-now.com/.
  <br/>
  * Type: string
  * Importance: high

`auth.type`
: The authentication type of the endpoint. Valid values are `BASIC` or `OAUTH2`.
  <br/>
  * Type: string
  * Default: BASIC
  * Importance: high

`connection.user`
: The username for an endpoint requiring basic authentication.
  <br/>
  * Type: string
  * Importance: medium

`connection.password`
: The password for an endpoint requiring basic authentication.
  <br/>
  * Type: password
  * Importance: medium

`oauth2.token.url`
: The URL for fetching OAuth2 token. Supported grant type is Client Credentials.
  <br/>
  * Type: string
  * Importance: medium

`oauth2.client.id`
: The client ID for fetching the OAuth2 token.
  <br/>
  * Type: string
  * Importance: medium

`oauth2.client.secret`
: The client secret for fetching the OAuth2 token.
  <br/>
  * Type: password
  * Importance: medium

`oauth2.token.property`
: The name of the property that contains the OAuth2 token returned by the OAuth2 token URL (defaults to access_token).
  <br/>
  * Type: string
  * Default: access_token
  * Importance: medium

`oauth2.client.scope`
: The scope parameter sent to the service when fetching the OAuth2 token.
  <br/>
  * Type: string
  * Default: any
  * Importance: medium

`oauth2.client.auth.mode`
: The encoding method of the `client_id` and `client_secret` in an OAuth2 authorization request. If set to `header`, the credentials are encoded as an Authorization: Basic <base-64 encoded client_id:client_secret> HTTP header. If set to url, the credentials are sent as URL-encoded parameters.
  <br/>
  * Type: string
  * Default: header
  * Importance: medium

`oauth2.client.headers`
: HTTP headers that should be included in the OAuth2 client endpoint. Individual headers must be separated by a |.
  <br/>
  * Type: password
  * Importance: low

`servicenow.ssl.enabled`
: Determine whether the connection to the endpoint should use SSL.
  <br/>
  * Type: boolean
  * Default: false
  * Importance: medium

`servicenow.ssl.keystorefile`
: The keystore that contains the client certificate and private key. Supported formats are JKS or PKCS12. File system paths are not supported.
  <br/>
  * Type: password
  * Default: [hidden]
  * Importance: low

`servicenow.ssl.keystore.password`
: The store password for the key store file.
  <br/>
  * Type: password
  * Importance: high

`servicenow.ssl.key.password`
: The password for the private key in the key store file.
  <br/>
  * Type: password
  * Importance: high

`servicenow.ssl.truststorefile`
: The truststore that contains the server CA certificate(s). Supported formats are JKS or PKCS12. File system paths are not supported.
  <br/>
  * Type: password
  * Default: [hidden]
  * Importance: high

`servicenow.ssl.truststore.password`
: The trust store password containing a server CA certificate.
  <br/>
  * Type: password
  * Importance: high

`servicenow.ssl.protocol`
: The protocol to use for SSL connections.
  <br/>
  * Type: string
  * Default: TLSv1.3
  * Importance: medium

### Tables

`tables.num`
: The number of tables to fetch data from. This value should be less than or equal to 5.
  <br/>
  * Type: int
  * Default: 1
  * Valid Values: [1,…,5]
  * Importance: high

### Reporter

`reporter.error.topic.name`
: The name of the topic to produce errant records after each unsuccessful API operation. Defaults to ‘error-${connector}’ if not set. You can provide `${connector}` in the value to use it as a placeholder for the logical cluster ID.
  <br/>
  * Type: string
  * Default: error-${connector}
  * Importance: low

### Retry configurations

`retry.backoff.policy`
: The backoff policy to use for retry attempts. Valid values are CONSTANT_VALUE or EXPONENTIAL_WITH_JITTER.
  <br/>
  * Type: string
  * Default: EXPONENTIAL_WITH_JITTER
  * Importance: medium

`retry.backoff.ms`
: The initial wait time in milliseconds after an error before a retry attempt is made. Subsequent backoff attempts can be a constant value or exponential with jitter (set via the retry.backoff.policy parameter). Jitter adds randomness to the exponential backoff algorithm to prevent synchronized retries.
  <br/>
  * Type: int
  * Default: 3000 (3 seconds)
  * Valid Values: [100,…]
  * Importance: medium

`retry.on.status.codes`
: A comma-separated list of HTTP status codes or a range of codes to retry on. Ranges are specified with a starting code and an optional ending code. The range boundaries are inclusive. For instance, “400-” includes all codes greater than or equal to 400, and “400-500” includes codes from 400 to 500, including 500 itself. Multiple ranges and single codes can be combined for fine-grained control over retry behavior. For example, “404, 408, 500-” will retry on 404 NOT FOUND, 408 REQUEST TIMEOUT, and all 5xx error codes. Note that certain status codes, such as unauthorized, timeouts, and too many requests, will always prompt a retry.
  <br/>
  * Type: string
  * Default: 400-
  * Importance: medium

`max.retries`
: The maximum number of retries on errors before a task is failed.
  <br/>
  * Type: int
  * Default: 3
  * Importance: medium

### Additional Configs

`header.converter`
: The converter class for the headers. This is used to serialize and deserialize the headers of the messages.
  <br/>
  * Type: string
  * Importance: low

`producer.override.compression.type`
: The compression type for all data generated by the producer. Valid values are none, gzip, snappy, lz4, and zstd.
  <br/>
  * Type: string
  * Importance: low

`producer.override.linger.ms`
: The producer groups together any records that arrive in between request transmissions into a single batched request. More details can be found in the documentation: [https://docs.confluent.io/platform/current/installation/configuration/producer-configs.html#linger-ms](https://docs.confluent.io/platform/current/installation/configuration/producer-configs.html#linger-ms).
  <br/>
  * Type: long
  * Valid Values: [100,…,1000]
  * Importance: low

`value.converter.allow.optional.map.keys`
: Allow optional string map key when converting from Connect Schema to Avro Schema. Applicable for Avro Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.auto.register.schemas`
: Specify if the Serializer should attempt to register the Schema.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.connect.meta.data`
: Allow the Connect converter to add its metadata to the output schema. Applicable for Avro Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.enhanced.avro.schema.support`
: Enable enhanced schema support to preserve package information and Enums. Applicable for Avro Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.enhanced.protobuf.schema.support`
: Enable enhanced schema support to preserve package information. Applicable for Protobuf Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.flatten.unions`
: Whether to flatten unions (oneofs). Applicable for Protobuf Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.generate.index.for.unions`
: Whether to generate an index suffix for unions. Applicable for Protobuf Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.generate.struct.for.nulls`
: Whether to generate a struct variable for null values. Applicable for Protobuf Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.int.for.enums`
: Whether to represent enums as integers. Applicable for Protobuf Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.latest.compatibility.strict`
: Verify latest subject version is backward compatible when use.latest.version is true.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.object.additional.properties`
: Whether to allow additional properties for object schemas. Applicable for JSON_SR Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.optional.for.nullables`
: Whether nullable fields should be specified with an optional label. Applicable for Protobuf Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.optional.for.proto2`
: Whether proto2 optionals are supported. Applicable for Protobuf Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.scrub.invalid.names`
: Whether to scrub invalid names by replacing invalid characters with valid characters. Applicable for Avro and Protobuf Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.use.latest.version`
: Use latest version of schema in subject for serialization when auto.register.schemas is false.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.use.optional.for.nonrequired`
: Whether to set non-required properties to be optional. Applicable for JSON_SR Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.wrapper.for.nullables`
: Whether nullable fields should use primitive wrapper messages. Applicable for Protobuf Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.wrapper.for.raw.primitives`
: Whether a wrapper message should be interpreted as a raw primitive at root level. Applicable for Protobuf Converters.
  <br/>
  * Type: boolean
  * Importance: low

`errors.tolerance`
: Use this property if you would like to configure the connector’s error handling behavior. WARNING: This property should be used with CAUTION for SOURCE CONNECTORS as it may lead to dataloss. If you set this property to ‘all’, the connector will not fail on errant records, but will instead log them (and send to DLQ for Sink Connectors) and continue processing. If you set this property to ‘none’, the connector task will fail on errant records.
  <br/>
  * Type: string
  * Default: none
  * Importance: low

`key.converter.key.schema.id.serializer`
: The class name of the schema ID serializer for keys. This is used to serialize schema IDs in the message headers.
  <br/>
  * Type: string
  * Default: io.confluent.kafka.serializers.schema.id.PrefixSchemaIdSerializer
  * Importance: low

`key.converter.key.subject.name.strategy`
: How to construct the subject name for key schema registration.
  <br/>
  * Type: string
  * Default: TopicNameStrategy
  * Importance: low

`value.converter.decimal.format`
: Specify the JSON/JSON_SR serialization format for Connect DECIMAL logical type values with two allowed literals:
  <br/>
  BASE64 to serialize DECIMAL logical types as base64 encoded binary data and
  <br/>
  NUMERIC to serialize Connect DECIMAL logical type values in JSON/JSON_SR as a number representing the decimal value.
  <br/>
  * Type: string
  * Default: BASE64
  * Importance: low

`value.converter.flatten.singleton.unions`
: Whether to flatten singleton unions. Applicable for Avro and JSON_SR Converters.
  <br/>
  * Type: boolean
  * Default: false
  * Importance: low

`value.converter.ignore.default.for.nullables`
: When set to true, this property ensures that the corresponding record in Kafka is NULL, instead of showing the default column value. Applicable for AVRO,PROTOBUF and JSON_SR Converters.
  <br/>
  * Type: boolean
  * Default: false
  * Importance: low

`value.converter.reference.subject.name.strategy`
: Set the subject reference name strategy for value. Valid entries are DefaultReferenceSubjectNameStrategy or QualifiedReferenceSubjectNameStrategy. Note that the subject reference name strategy can be selected only for PROTOBUF format with the default strategy being DefaultReferenceSubjectNameStrategy.
  <br/>
  * Type: string
  * Default: DefaultReferenceSubjectNameStrategy
  * Importance: low

`value.converter.value.schema.id.serializer`
: The class name of the schema ID serializer for values. This is used to serialize schema IDs in the message headers.
  <br/>
  * Type: string
  * Default: io.confluent.kafka.serializers.schema.id.PrefixSchemaIdSerializer
  * Importance: low

`value.converter.value.subject.name.strategy`
: Determines how to construct the subject name under which the value schema is registered with Schema Registry.
  <br/>
  * Type: string
  * Default: TopicNameStrategy
  * Importance: low

### Table - 1 configurations

`table1.name`
: The table name, combined with the ServiceNow Instance URL, will form the complete HTTP(S) URL. This path can be templated to include offset information.
  <br/>
  * Type: string
  * Default: “”
  * Importance: high

`table1.topic`
: Specify the topic to which data will be pushed for this table.
  <br/>
  * Type: string
  * Default: “”
  * Importance: high

`table1.batch.size`
: Size of the batch of records to be fetched from the ServiceNow table. Note that Basic and Standard Clusters may experience throughput limitations, even with a higher batch size.
  <br/>
  * Type: int
  * Default: 5000
  * Valid Values: [1,…,50000]
  * Importance: medium

`table1.start.timestamp`
: Time to start fetching all updates/creation. Defaults to 1970-01-01 00:00:00. Note that the time is in UTC and requires format: yyyy-MM-dd HH:mm:ss.
  <br/>
  * Type: string
  * Default: 1970-01-01 00:00:00
  * Importance: medium

`table1.timestamp.field`
: Timestamp Field to be used for pagination.
  <br/>
  * Type: string
  * Default: sys_updated_on
  * Importance: medium

`table1.pagination.query`
: The query to be used for pagination on the table can be templated with offset information - ${offset}. Note that all other table-related configurations will be ignored if this is configured. It defaults to a timestamp-based pagination query. An example query is closed_at>=${offset}^ORDERBYclosed_at, where ${offset} refers to the pagination query offset field - closed_at.
  <br/>
  * Type: string
  * Default: “”
  * Importance: low

`table1.pagination.query.field`
: Offset field if pagination query is used.
  <br/>
  * Type: string
  * Default: “”
  * Importance: low

`table1.request.parameters.separator`
: Specifies the character used to separate ServiceNow query parameters. This character must not be present in the provided pagination query. Defaults to `&`. If `&` is part of your pagination query, set it to an alternative separator, such as `|`. Do not use `=`, `_` or any alphanumeric character.
  <br/>
  * Type: string
  * Default: &
  * Importance: low

`table1.display.value`
: Specify whether to display values for the ServiceNow table records.
  <br/>
  * Type: boolean
  * Default: false
  * Importance: low

`table1.allowlisted.fields`
: A comma-separated list of fields that should be included in the Kafka record. The list must necessarily include the selected timestamp field (either sys_updated_on or sys_created_on) and the sys_id field. It defaults to all fields from the response.
  <br/>
  * Type: string
  * Default: “”
  * Importance: low

`table1.request.interval.ms`
: The time in milliseconds to wait between consecutive requests.
  <br/>
  * Type: int
  * Default: 2000 (2 seconds)
  * Valid Values: [2000,…]
  * Importance: medium

`table1.exclude.reference.link`
: Indicates whether to exclude Table API links for reference fields. By default, it includes all the Table API links.
  <br/>
  * Type: boolean
  * Default: false
  * Importance: medium

`table1.query.category`
: Name of the category to use for queries.
  <br/>
  * Type: string
  * Default: “”
  * Importance: medium

`table1.count.records`
: Indicates if a `SELECT COUNT(*)` query will run to retrieve the row count on the table. Setting it to `true` enables this query.
  <br/>
  * Type: boolean
  * Default: false
  * Importance: medium

`table1.query.domain`
: Indicates whether to restrict the record search to the domains that are accessible to the logged in user . If set to `true`, it excludes the records from domains that the current logged in user can’t access.
  <br/>
  * Type: boolean
  * Default: true
  * Importance: medium

`table1.suppress.pagination.header`
: Indicates whether to remove the Link header from the response. The Link header provides various URLs to relative pages in the record set which you can use to paginate the returned record set.
  <br/>
  * Type: boolean
  * Default: true
  * Importance: medium

### Auto-restart policy

`auto.restart.on.user.error`
: Enable connector to automatically restart on user-actionable errors.
  <br/>
  * Type: boolean
  * Default: true
  * Importance: medium

<a id="cc-servicenow-source-v2-faq"></a>

## Frequently asked questions

Find answers to frequently asked questions about the ServiceNow Source V2 connector for Confluent Cloud.

### Schema and data management

#### Why is the connector creating multiple schema versions for the same table?

The ServiceNow Source V2 connector uses schema-aware converters that dynamically infer schemas from the ServiceNow API responses.
Schema versions can increase when:

* ServiceNow returns different sets of fields in different API responses.
* Fields appear or disappear in responses during initial data loads.
* The connector processes tables with evolving data structures.

This behavior is expected, especially during initial backfills when the connector encounters varying field combinations.

**To minimize schema evolution:**

* Stabilize your ServiceNow table schema before starting the connector.
* Avoid adding or removing fields during initial data loads.
* Set Schema Registry compatibility mode based on your specific requirements.

#### Does the connector capture deleted records from ServiceNow?

No, the ServiceNow Source V2 connector does not emit delete events or tombstone records when rows are deleted in ServiceNow.
The connector only streams creations and updates based on the `sys_updated_on` or `sys_created_on` timestamp fields.

If you need to handle deletes in your downstream applications:

* Implement soft deletes in ServiceNow (use a status field or `deleted` flag that the connector can capture as an update).
* Use ServiceNow’s audit tables or change history if available for your use case.
* Build custom logic in your downstream consumers to detect missing records.

#### Can I filter which fields are ingested from ServiceNow tables?

Yes, you can use the `table{i}.allowlisted.fields` property (equivalent to ServiceNow’s `sysparm_fields` parameter)
to specify a comma-separated list of fields to include in the API response:

```json
{
  "table1.name": "incident",
  "table1.allowlisted.fields": "number,short_description,priority,state,assigned_to"
}
```

This reduces payload size and improves performance by excluding fields you don’t need. Only the specified fields
are retrieved from ServiceNow and sent to your Kafka topic.

### Configuration

#### Why can’t I set the polling interval below two seconds?

The ServiceNow Source V2 connector enforces a minimum `table{i}.request.interval.ms` of 2000 milliseconds (two seconds)
to prevent data loss caused by time drift between the ServiceNow instance and the connector.

ServiceNow’s timestamp fields such as `sys_updated_on` provide precision only to one second. Setting a polling interval
below two seconds can cause the connector to miss updates that occur within the same second, resulting in data loss or duplicate records.

The two second minimum ensures reliable timestamp-based pagination across distributed systems with potential clock differences.

#### How many tables can I configure per connector?

The ServiceNow Source V2 connector supports up to five ServiceNow tables per connector instance. Each table requires its own configuration block:

```json
{
  "tables.num": "3",
  "table1.name": "incident",
  "table1.topic": "incidents-topic",
  "table2.name": "change_request",
  "table2.topic": "changes-topic",
  "table3.name": "problem",
  "table3.topic": "problems-topic"
}
```

Set `tasks.max` to a value less than or equal to the number of tables configured for optimal performance.
Each task can process one or more tables, but having more tasks than tables results in idle tasks.

#### How does the connector handle ServiceNow table views?

The ServiceNow Source V2 connector can read from ServiceNow table views, but the view must be accessible via the
ServiceNow Table API and the configured ServiceNow user must have read permissions.

When using views:

* Specify the view name in the `table{i}.name` field.
* Ensure the view includes the timestamp field (`sys_updated_on` or `sys_created_on`) that the connector uses for pagination.
* Verify access control lists (ACLs) in ServiceNow allow the connector’s user to query the view.

If the connector fails to access a view, check the ServiceNow access logs and confirm the user has the necessary permissions.

### Troubleshooting

#### Why is the connector running but not producing any data?

If the connector status shows `RUNNING` but no records appear in your Kafka topics, check the following:

* **Verify table names and permissions:** Ensure the ServiceNow user has read access to all configured tables (`table1.name`, `table2.name`, and so on).
* **Check timestamp filters:** If you set `table{i}.start.timestamp`, verify it is not set to a future date or beyond the latest records in your ServiceNow table.
* **Review connector offsets:** Use the [offset management API](#cc-servicenow-source-v2-custom-offsets) to check if offsets have advanced beyond available data.
* **Inspect ServiceNow access logs:** Verify the connector is successfully making API requests and receiving responses from ServiceNow.
* **Check for errors:** Review the connector error topic and Confluent Cloud Console for any task failures or API errors.

#### Why do I see offset-related errors in the connector logs?

Offset-related errors such as `invalid offset` or `http.offset.json.primary.key.pointer` exceptions occur when:

* The connector’s offset store contains corrupted or invalid offset data.
* Offsets were manually edited incorrectly.
* ServiceNow table structure changed (for example, timestamp field was removed).

**To resolve offset issues:**

1. Use the [offset management API](#cc-servicenow-source-v2-custom-offsets) to inspect the current offsets for your connector.
2. Reset offsets to a known good state or to a specific timestamp using the `PATCH` or `DELETE` operations documented in the offset management section.
3. Restart the connector after correcting the offsets.

#### NOTE
Resetting offsets may cause the connector to re-read data from ServiceNow. Plan accordingly to handle potential duplicate records in your downstream systems.

#### The connector fails with authentication or permission errors

If the connector fails with HTTP 401 (Unauthorized) or HTTP 403 (Forbidden) errors, check the following:

* **Verify credentials**: Ensure your ServiceNow username, password, or OAuth credentials are correct and not expired.
* **Check user permissions**: Confirm the ServiceNow user has read access to all tables specified in your configuration (`table1.name`, `table2.name`, and so on).
* **Verify field-level access**: The user must have read permissions for all fields being queried, including timestamp fields like `sys_updated_on` or `sys_created_on`.
* **Review ACL changes**: If you recently updated ServiceNow permissions for the user, restart the connector to ensure it picks up the permission changes. The connector may continue using cached credentials until restarted.

For OAuth authentication, ensure:

* The OAuth client credentials are valid and not expired.
* The OAuth client has the necessary scopes and permissions in ServiceNow.
* The ServiceNow OAuth configuration allows the connector’s authentication requests.

## Next Steps

For an example that shows fully managed Confluent Cloud connectors in action with
Confluent Cloud for Apache Flink, see the [Cloud ETL Demo](/platform/current/tutorials/examples/cloud-etl/docs/index.html).
This example also shows how to use Confluent CLI to manage your resources in
Confluent Cloud.

[![image](images/topology.png)](https://docs.confluent.io/platform/current/tutorials/examples/cloud-etl/docs/index.html)
