---
title: List ServiceNow incidents
source: https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/servicenow/servicenow-incident-list
---

Gets a list of incidents from ServiceNow using the Table API.

For authentication setup, see [ServiceNow Incident actions](https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/servicenow/servicenow-incident).

## Inputs

| Input Field    | Optionality | Type   | Description                                                                                                                                                  | Example                                                                                                                                                                                                                                                                                                                                                           |
| -------------- | ----------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **domain**     | Required    | String | Domain of the ServiceNow instance. Used to construct the base URL `your-domain.service-now.com`.                                                             | `"your-domain"`                                                                                                                                                                                                                                                                                                                                                   |
| **apiKey**     | Required    | String | ServiceNow REST API Key for authentication. Passed as the `x-sn-apikey` request header. Must be provided as a secret.                                        | `"${{ :secrets:serviceNowApiKey }}"`                                                                                                                                                                                                                                                                                                                              |
| **parameters** | Optional    | Map    | Optional URL query parameters for the ServiceNow API request. Controls the format and content of the API response. See the parameters reference table below. | `"{\"sysparm_fields\": \"name,short_description\", \"sysparm_exclude_reference_link\": \"true\", \"sysparm_input_display_value\": \"false\", \"sysparm_display_value\": \"true\"}"` See [Export to OpenAPI specification](https://www.servicenow.com/docs/r/api-reference/rest-api-explorer/export-openapi-specification.html) for a list of accepted parameters. |
| **selectors**  | Optional    | List   |                                                                                                                                                              | `[{\"name\": \"incidentNumber\", \"expression\": \".responseBody.result.number\"}]`                                                                                                                                                                                                                                                                               |

> #### ⚠️ COMMON URL PARAMETERS REFERENCE
>
> | Parameter                           | Type   | Description                                                                                              | Default   |
> | ----------------------------------- | ------ | -------------------------------------------------------------------------------------------------------- | --------- |
> | **sysparm_fields**                  | String | Comma-separated list of fields to return in the response.                                                |           |
> | **sysparm_exclude_reference_link**  | String | `true` or `false` to exclude reference links from the response.                                          | `false`   |
> | **sysparm_display_value**           | String | `true`, `false`, or `all` to return display values instead of actual values.                             | `false`   |
> | **sysparm_input_display_value**     | String | `true` or `false`. When `true`, sets field values using their display value instead of the actual value. | `false`   |
> | **sysparm_suppress_auto_sys_field** | String | `true` or `false`. When `true`, suppresses auto-generation of system fields.                             | `false`   |
> | **sysparm_view**                    | String | Renders the response according to a specific UI view. Overridden by `sysparm_fields`.                    | `default` |
> | **sysparm_query_no_domain**         | String | `true` or `false`. When `true`, allows access to data across domains if authorized.                      | `false`   |

## Outputs

| Output Field     | Type    | Example                                                                                                                                                                                             |
| ---------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **response**     | Object  | ```yaml { "result": {     "number": "INC0019382",     "description": "The server is on fire.",     "short_description": "The server is on fire.",     ....     .... } } ```                         |
| **success**      | Boolean | `success: true | false`                                                                                                                                                                             |
| **errorMessage** | String  | ```yaml [   {     "success": false,     "errorMessage": "{\"error\":{\"message\":\"User Not Authenticated\",\"detail\":\"Required to provide Auth information\"},\"status\":\"failure\"}"   } ] ``` |

## Example

| Workflow example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ```yaml name: get-servicenow-incident-list description: to get list of incident from ServiceNow steps:   - type: action     name: listIncidents     action: serviceNow.incident.list     version: 1     inputs:       domain: "your-domain"       apiKey: "${{ :secrets:serviceNowApiKey }}"       parameters:         sysparm_fields: "number,short_description,description"         sysparm_limit: "5"       selectors:         - name: incidents           expression: .responseBody.result     next: end ``` |
