> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# ServiceNow connector

- Connector: `appmixer.servicenow`
- Version: 4.0.3
- Components: 12 (3 triggers, 9 actions)

ServiceNow allows employees to work the way they want to, not how software dictates they have to. And customers can get what they need, when they need it.

- Connector page: <https://connectors.appmixer.com/connector/appmixer.servicenow/4.0.3>
- Documentation: <https://docs.appmixer.com/connector-configuration/servicenow>
- Source code: <https://github.com/clientIO/appmixer-connectors/tree/dev/src/appmixer/servicenow>
- Download package: <https://connectors.appmixer.com/connector/appmixer.servicenow/4.0.3/download>

## Authentication

**Type:** API Key

**Fields:**

- `Username (Auth Option 1)` (text): For example: admin
- `Password (Auth Option 1)` (text): On instances that restrict Basic auth, the user needs the snc_basic_auth_api_access role.
- `API Key (Auth Option 2)` (text): If API Key is entered, the username and password is ignored
- `Instance name (Required)` (text): For example: dev144860
- `Webhook Secret (Required for triggers)` (password): A random string of at least 16 characters. Your ServiceNow business rule must send it in the X-Appmixer-Secret header of every event; events without the matching secret are ignored.

## Triggers (3)

- [Deleted Record](https://connectors.appmixer.com/connector/appmixer.servicenow/4.0.3/component/appmixer.servicenow.record.DeletedRecord.md) (`appmixer.servicenow.record.DeletedRecord`): Triggers when a record is deleted from the specified table.
- [New Record](https://connectors.appmixer.com/connector/appmixer.servicenow/4.0.3/component/appmixer.servicenow.record.NewRecord.md) (`appmixer.servicenow.record.NewRecord`): Triggers when a record is inserted into a specified table.
- [Updated Record](https://connectors.appmixer.com/connector/appmixer.servicenow/4.0.3/component/appmixer.servicenow.record.UpdatedRecord.md) (`appmixer.servicenow.record.UpdatedRecord`): Triggers when a record in the specified table is updated.

## Actions (9)

- [Make Api Call](https://connectors.appmixer.com/connector/appmixer.servicenow/4.0.3/component/appmixer.servicenow.core.MakeApiCall.md) (`appmixer.servicenow.core.MakeApiCall`): Performs an arbitrary authorized API call to the ServiceNow API.
- [Create Record - Legacy](https://connectors.appmixer.com/connector/appmixer.servicenow/4.0.3/component/appmixer.servicenow.record.CreateRecord.md) (`appmixer.servicenow.record.CreateRecord`): Inserts one record in the specified table. Multiple record insertion is not supported by this method.
- [Create Record - v2](https://connectors.appmixer.com/connector/appmixer.servicenow/4.0.3/component/appmixer.servicenow.record.CreateRecordV2.md) (`appmixer.servicenow.record.CreateRecordV2`): Inserts a single record into the specified table. This method does not support inserting multiple records.
- [Delete Record](https://connectors.appmixer.com/connector/appmixer.servicenow/4.0.3/component/appmixer.servicenow.record.DeleteRecord.md) (`appmixer.servicenow.record.DeleteRecord`): Deletes the specified record from the specified table.
- [Get Record](https://connectors.appmixer.com/connector/appmixer.servicenow/4.0.3/component/appmixer.servicenow.record.GetRecord.md) (`appmixer.servicenow.record.GetRecord`): Retrieves the record identified by the specified sys_id from the specified table.
- [Get Table Schema](https://connectors.appmixer.com/connector/appmixer.servicenow/4.0.3/component/appmixer.servicenow.record.GetTableSchema.md) (`appmixer.servicenow.record.GetTableSchema`): Retrieves the record identified by the specified sys_id from the specified table.
- [List Records](https://connectors.appmixer.com/connector/appmixer.servicenow/4.0.3/component/appmixer.servicenow.record.ListRecords.md) (`appmixer.servicenow.record.ListRecords`): Retrieves multiple records for the specified table.
- [Update Record - Legacy](https://connectors.appmixer.com/connector/appmixer.servicenow/4.0.3/component/appmixer.servicenow.record.UpdateRecord.md) (`appmixer.servicenow.record.UpdateRecord`): Updates the specified record either with the request body or with specific name-value pairs included in the request body.
- [Update Record - v2](https://connectors.appmixer.com/connector/appmixer.servicenow/4.0.3/component/appmixer.servicenow.record.UpdateRecordV2.md) (`appmixer.servicenow.record.UpdateRecordV2`): Updates the specified record either with the request body or with specific name-value pairs included in the request body.

## Changelog

### 4.0.3

- Authentication: the instance name is validated before it is used to build request URLs. Only a plain instance name (letters, digits and hyphens, e.g. "dev144860" for dev144860.service-now.com) is accepted.

### 4.0.2

- MakeApiCall: Request Headers and Query Parameters set in the Designer are now sent. They were silently dropped: the key-value field stores its rows as a JSON object string, which the component did not parse.

### 4.0.1

- Fixed intermittent "Parse Error: Expected HTTP/" (HPE_INVALID_CONSTANT) failures in components that read from ServiceNow. Every GET request was sent with an empty JSON body ({}), which ServiceNow does not read; on a reused connection those stray bytes corrupted the next response. This hit paginated reads such as List Records hardest, because they issue many GET requests in a row. GET and HEAD requests are now sent without a body.

### 4.0.0

- (Breaking Change) Security: NewRecord, UpdatedRecord and DeletedRecord only receive events sent with the connection's Webhook Secret in the X-Appmixer-Secret header. Events for one instance can no longer be delivered to flows of another connection.
- Added Webhook Secret to the connection. The triggers check the credentials against the instance before they register.
- Migration: reconnect the ServiceNow account with a Webhook Secret (at least 16 characters) and send it in the X-Appmixer-Secret header from your business rules.
- MakeApiCall: Query Parameters and Headers set in the designer are sent with the request (they were ignored before). Invalid JSON in them now stops the call with an error.
- Connection: a rejected username and password now says that the user needs the snc_basic_auth_api_access role on instances that restrict Basic auth.

### 3.2.0

- Added test() method to NewRecord, UpdatedRecord and DeletedRecord triggers for Flow Test Mode support.

### 3.1.0

- add MakeApiCall component with key-value array inputs for headers and parameters per standard #1459

### 3.0.1

- Reduced icon size for better performance.

### 3.0.0

- Breaking Change: CreateRecord, UpdateRecord renamed to CreateRecord v2, UpdateRecord v2 to distinguish from the previous versions. CreateRecord and UpdateRecord are now backwards compatible with the v1 versions and labeled as Create Record - Legacy and Update Record - Legacy.

### 2.2.0

- Added API Key authentication support to connection.

### 2.1.0

- Added triggers: UpdatedRecord and DeletedRecord.

### 2.0.1

- (Breaking Change) CreateRecord, UpdateRecord: There's no longer a need to specify the input as JSON. The 'record' input has been removed; now, inputs are generated based on the retrieved table schema.
- Migration: The Table Name and its columns must be defined.

### 1.1.2

- Version compatible with Appmixer engine 6.
- Added trigger: NewRecord.

### 1.1.1

- Version compatible with Appmixer engine 5.
- Removed trigger: NewRecord.

### 1.1.0

- Added new trigger: NewRecord

### 1.0.0

- Initial version
