Endpoint Get Table Row Count
Name
get_table_row_count
Description
Get table row count (count for all rows or for specified query filter) [API reference]
Parameters
| Parameter | Required | Options | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Name:
Label: TableName Table name |
YES | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Name:
Label: Query / Order By (Server Side Filter) Server-side encoded query for filtering and ordering records. Supports string, numeric, date, NULL checks, AND/OR logic, and ORDER BY clauses. |
|
Output Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description |
|---|---|---|---|---|
| count |
DT_I8
|
bigint
|
If the column you are looking for is missing, consider customizing ServiceNow Connector.
Input Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Examples
SSIS
Use ServiceNow Connector in API Source or in API Destination SSIS Data Flow components to read or write data.
API Source
API Source - ServiceNow
Read and write ServiceNow data effortlessly. Integrate, manage, and automate incidents, tasks, attachments, and records — almost no coding required.
ServiceNow
Get Table Row Count
| Required Parameters | |
|---|---|
| TableName | Fill-in the parameter... |
| Optional Parameters | |
| Query / Order By (Server Side Filter) | |
API Destination
API Destination - ServiceNow
Read and write ServiceNow data effortlessly. Integrate, manage, and automate incidents, tasks, attachments, and records — almost no coding required.
ServiceNow
Get Table Row Count
| Required Parameters | |
|---|---|
| TableName | Fill-in the parameter... |
| Optional Parameters | |
| Query / Order By (Server Side Filter) | |
ODBC application
Use these SQL queries in your ODBC application data source:
Get Table Row Count Using Server-Side Filters
-- Count ALL records in the Incident table
-- Uses server-side counting (no data rows are downloaded)
SELECT count
FROM get_table_row_count
WITH(
TableName='incident'
)
-- Count only HIGH PRIORITY incidents (priority = 1)
-- The Query parameter applies an encoded ServiceNow filter before counting
SELECT count
FROM get_table_row_count
WITH(
TableName='incident',
Query='priority=1'
)
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Get Table Row Count Using Server-Side Filters
DECLARE @MyQuery NVARCHAR(MAX) = '-- Count ALL records in the Incident table
-- Uses server-side counting (no data rows are downloaded)
SELECT count
FROM get_table_row_count
WITH(
TableName=''incident''
)
-- Count only HIGH PRIORITY incidents (priority = 1)
-- The Query parameter applies an encoded ServiceNow filter before counting
SELECT count
FROM get_table_row_count
WITH(
TableName=''incident'',
Query=''priority=1''
)';
EXEC (@MyQuery) AT [LS_TO_SERVICENOW_IN_GATEWAY];