# ServiceNow

ServiceNow is a cloud-based enterprise platform that helps organizations automate and manage digital workflows across IT, HR, customer service, and operations.

- **Category:** it operations
- **Auth:** BASIC
- **Composio Managed App Available?** N/A
- **Tools:** 5
- **Triggers:** 0
- **Slug:** `SERVICENOW`
- **Version:** 20260307_00

## Tools

### Attach file to record

**Slug:** `SERVICENOW_ATTACH_FILE_TO_RECORD`

Attaches a file to a specified record in a ServiceNow table. This action uploads a file and associates it with a specific record (e.g., incident, problem, change request). The file will be visible in the ServiceNow UI under the record's attachments section. Common use cases: - Attach screenshots to incident reports - Upload documents to change requests - Add log files to problem records - Store evidence files for security incidents The action returns complete attachment metadata including download link, file size, and creation details. Note: This action permanently modifies a live ServiceNow instance — attachments cannot be bulk-removed once added.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file_name` | string | Yes | Name to give the attachment (e.g., 'report.pdf', 'screenshot.png'). This will be the visible filename in ServiceNow. |
| `table_name` | string | Yes | Name of the ServiceNow table to attach the file to (e.g., 'incident', 'problem', 'change_request'). |
| `creation_time` | string | No | Creation date and time of the attachment. Use this parameter to capture attachment creation times when the Now Mobile app is offline and the attachment is uploaded to a record at a later time. |
| `record_sys_id` | string | Yes | Sys_id of the specific record in the table to attach the file to. This is the unique identifier of the record (e.g., incident sys_id). |
| `file_to_upload` | object | Yes | File to upload. |
| `encryption_context` | string | No | Sys_id of an encryption context record. Specify this parameter to allow only users with the specified encryption context to access the attachment. For additional information on encryption context records, see https://www.servicenow.com/docs/csh?topicname=column-level-encryption-landing&version=yokohama&pubname=yokohama-platform-security. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | object | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create a record

**Slug:** `SERVICENOW_CREATE_A_RECORD`

Creates a new record in a specified ServiceNow table with the provided field values. Common tables include: 'incident', 'problem', 'change_request', 'task', 'sys_user'. The created record is returned with its sys_id and auto-generated number.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `table_name` | string | Yes | The name of the table where the record will be created (e.g., 'incident', 'problem', 'change_request', 'sys_user'). |
| `record_data` | object | No | Field-value pairs for the new record. Available fields depend on the table schema. For 'incident' table, common fields include: 'short_description', 'description', 'urgency' (1-3), 'impact' (1-3), 'priority', 'assignment_group', 'assigned_to', 'category', 'state'. For reference fields (like 'assignment_group' or 'assigned_to'), use the sys_id of the referenced record, or set sysparm_input_display_value=true to use display values. Example: {'short_description': 'Network outage', 'urgency': '1', 'impact': '1', 'description': 'Unable to access network'} |
| `sysparm_view` | string ("desktop" | "mobile" | "both") | No | UI view to determine which fields are returned in the response. If not specified, returns fields from the default view. |
| `sysparm_fields` | string | No | Comma-separated list of fields to return in the response (e.g., 'number,short_description,state'). Invalid fields are ignored. If not specified, all fields are returned. |
| `sysparm_display_value` | string ("true" | "false" | "all") | No | Determines the type of data returned in the response. 'false': Returns actual database values (sys_ids for references, numeric values for choices). 'true': Returns display values (names for references, text labels for choices). 'all': Returns both display and actual values. |
| `sysparm_input_display_value` | boolean | No | Set to true if providing display values (e.g., user names) instead of sys_ids in record_data for reference fields. When false (default), reference fields must contain sys_ids. |
| `sysparm_exclude_reference_link` | boolean | No | Set to true to exclude Table API links for reference fields in the response. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | object | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete a record

**Slug:** `SERVICENOW_DELETE_A_RECORD`

Permanently deletes a specific record from a ServiceNow table using its sys_id. This is a destructive operation that cannot be undone. The record will be permanently removed from the table. Requires the user to have delete permissions on the specified table. If the record doesn't exist or the user lacks permissions, an error will be returned. Common use cases: Removing test data, cleaning up duplicate records, deleting obsolete incidents/problems/tasks.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `sys_id` | string | Yes | The unique system ID (sys_id) of the record to delete. This is a 32-character hexadecimal string that uniquely identifies the record. Example: '8866498dc37a3610eb10d8477d013161'. The record must exist in the specified table, or a 404 error will be returned. |
| `table_name` | string | Yes | Name of the ServiceNow table from which to delete the record (e.g., 'incident', 'problem', 'change_request', 'task'). The table must exist in the ServiceNow instance and the user must have delete permissions for it. |
| `sysparm_query_no_domain` | boolean | No | Set to true to include records from domains the logged-in user is not configured to access (requires admin or query_no_domain_table_api role). When false (default), only records in the user's configured domains can be deleted. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | object | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Find file

**Slug:** `SERVICENOW_FIND_FILE`

Retrieves attachment metadata from ServiceNow's sys_attachment table. This endpoint queries file attachments and returns metadata including file name, size, content type, download links, and associated table information. Use sysparm_query to filter by file name, table name, content type, or other attachment properties. Note: This returns metadata only; use the download_link in the response to retrieve actual file content.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `sysparm_limit` | string | No | Limit to be applied on pagination. Note: Unusually large sysparm_limit values can impact system performance. |
| `sysparm_query` | string | No | Encoded query. Queries for the Attachment API are relative to the Attachments [sys_attachment] table. For example: (sysparm_query=file_name=attachment.doc) The encoded query provides support for order by. To sort responses based on certain fields, use the ORDERBY and ORDERBYDESC clauses in sysparm_query. For example, sysparm_query=ORDERBYfile_name^ORDERBYDESCtable_Name orders the results in ascending order by name first, then in descending order by table name. |
| `sysparm_offset` | string | No | Number of records to exclude from the query. Use this parameter to get more records than specified in sysparm_limit parameter. For example, if sysparm_limit is set to 500, but there are additional records you want to query, you can specify a sysparm_offset parameter value of 500 to get the second set of records. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | object | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get records

**Slug:** `SERVICENOW_GET_RECORDS`

Retrieves multiple records from a specified ServiceNow table with optional filtering and pagination. Use this action to query and fetch records from any ServiceNow table (e.g., incident, sys_user, problem). Supports filtering via sysparm_query, field selection, pagination, and display value options.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `table_name` | string | Yes | The name of the table from which to retrieve the record. |
| `sysparm_view` | string ("desktop" | "mobile" | "both") | No | UI view for which to render the data. Determines the fields returned in the response. |
| `sysparm_limit` | integer | No | Maximum number of records to return. For requests that exceed this number of records, use the sysparm_offset parameter to paginate record retrieval. This limit is applied before ACL evaluation. If no records return, including records you have access to, rearrange the record order so records you have access to return first. Note: Unusually large sysparm_limit values can impact system performance. |
| `sysparm_query` | string | No | Encoded query used to filter the result set. You can use a UI filter to obtain a properly encoded query. Syntax: sysparm_query=<col_name><operator><value>. <col_name>: Name of the table column to filter against. <operator>: Supports the following values: =: Exactly matches <value>. !=: Does not match <value>. ^: Logically AND multiple query statements. ^OR: Logically OR multiple query statements. LIKE: <col_name> contains the specified string. Only works for <col_name> fields whose data type is string. STARTSWITH: <col_name> starts with the specified string. Only works for <col_name> fields whose data type is string. ENDSWITH: <col_name> ends with the specified string. Only works for <col_name> fields whose data type is string. <value>: Value to match against. All parameters are case-sensitive. Queries can contain more than one entry, such as sysparm_query=<col_name><operator><value>[<operator><col_name><operator><value>]. For example: (sysparm_query=caller_id=javascript:gs.getUserID()^active=true) Encoded queries also support order by functionality. To sort responses based on certain fields, use the ORDERBY and ORDERBYDESC clauses in sysparm_query. Syntax: ORDERBY<col_name> ORDERBYDESC<col_name> For example: sysparm_query=active=true^ORDERBYnumber^ORDERBYDESCcategory This query filters all active records and orders the results in ascending order by number, and then in descending order by category. If part of the query is invalid, such as by specifying an invalid field name, the instance ignores the invalid part. It then returns rows using only the valid portion of the query. You can control this behavior using the property glide.invalid_query.returns_no_rows. Set this property to true to return no rows on an invalid query. Note: The glide.invalid_query.returns_no_rows property controls the behavior of all queries across the instance, such as in lists, scripts (GlideRecord.query()), and web service APIs. |
| `sysparm_fields` | string | No | Comma-separated list of fields to return in the response. Invalid fields are ignored. |
| `sysparm_offset` | integer | No | Starting record index for which to begin retrieving records. Use this value to paginate record retrieval. This functionality enables the retrieval of all records, regardless of the number of records, in small manageable chunks. For example, the first time you call this endpoint, sysparm_offset is set to '0'. To simply page through all available records, use sysparm_offset=sysparm_offset+sysparm_limit, until you reach the end of all records. Don't pass a negative number in the sysparm_offset parameter. |
| `name_value_pairs` | string | No | DEPRECATED: This parameter does not work in the ServiceNow Table API and will be ignored. Use 'sysparm_query' instead for filtering records. Example: sysparm_query='active=true^priority=1' for multiple conditions. |
| `sysparm_no_count` | boolean | No | Flag that indicates whether to execute a select count(*) query on the table to return the number of rows in the associated table. |
| `sysparm_display_value` | string ("true" | "false" | "all") | No | Determines the type of data returned, either the actual values from the database or the display values of the fields. Display values are manipulated based on the actual value in the database and user or system settings and preferences. If returning display values, the value that is returned is dependent on the field type. Choice fields: The database value may be a number, but the display value will be more descriptive. Date fields: The database value is in UTC format, while the display value is based on the user's time zone. Encrypted text: The database value is encrypted, while the displayed value is unencrypted based on the user's encryption context. Reference fields: The database value is sys_id, but the display value is a display field of the referenced record. |
| `sysparm_query_category` | string | No | Name of the category to use for queries. |
| `sysparm_query_no_domain` | boolean | No | Flag that indicates whether to restrict the record search to only the domains for which the logged in user is configured. Valid values: false (Exclude the record if it is in a domain that the currently logged in user is not configured to access), true (Include the record even if it is in a domain that the currently logged in user is not configured to access). Note: The sysparm_query_no_domain parameter is available only to system administrators or users who have the query_no_domain_table_api role. |
| `sysparm_exclude_reference_link` | boolean | No | Flag that indicates whether to exclude Table API links for reference fields. |
| `sysparm_suppress_pagination_header` | boolean | No | Flag that 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. Valid values: true (Remove the Link header from the response), false (Do not remove the Link header from the response). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | object | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
