get_data_view_count
Retrieve the total count of results for a specified data view query without fetching actual data. Useful for pagination planning, dataset size understanding, and performance optimization before full data retrieval. Supports simple counts, filtered queries, distinct counts, and aggregation-based calculations.
Instructions
Retrieve the total count of results for a specified data view query without fetching the actual data. This is useful for pagination planning, understanding dataset sizes, and performance optimization before executing full data retrieval operations.
Supports the same comprehensive query capabilities as get_list_data_view:
- Simple Count: Get total count of all records in a data view Example: { "dataViewID": "D_Employees" }
- Count with Parameters: Count records with data view parameters for parameterized data views Example: { "dataViewID": "D_CustomerOrders", "dataViewParameters": { "CustomerID": "C-123", "Status": "Active" } }
- Filtered Count: Count records matching specific filter criteria Example: { "dataViewID": "D_Employees", "query": { "filter": { "filterConditions": { "F1": { "lhs": {"field": "Department"}, "comparator": "EQ", "rhs": {"value": "IT"} } }, "logic": "F1" } } }
- Distinct Count: Count unique combinations of selected fields Example: { "dataViewID": "D_Employees", "query": { "select": [{"field": "Department"}], "distinctResultsOnly": true } }
- Aggregated Count: Count records with aggregation grouping Example: { "dataViewID": "D_Sales", "query": { "aggregations": { "TotalRevenue": { "field": "Revenue", "summaryFunction": "SUM" } }, "select": [{"aggregation": "TotalRevenue"}] } }
Filter comparators supported: boolean (IS_TRUE, IS_FALSE, IS_NULL, IS_NOT_NULL, EQ, NEQ), string (EQ, NEQ, IN, NOT_IN, IS_NULL, IS_NOT_NULL, STARTS_WITH, NOT_STARTS_WITH, ENDS_WITH, NOT_ENDS_WITH, CONTAINS, NOT_CONTAINS), number/date (EQ, NEQ, IN, NOT_IN, GT, GTE, LT, LTE, ISNULL, ISNOTNULL).
Aggregation functions: COUNT, MAX, MIN, DISTINCT_COUNT. For numbers: SUM, AVG.
Calculation functions: YEARS, QUARTERS, MONTHS, WEEKS, DAYS, HOURS, MONTHS_OF_YEAR, DAYS_OF_MONTH, DAYS_OF_WEEK, INTERVAL_GROUPING_FLOOR, INTERVAL_GROUPING_CEILING.
Note: Maximum result count is 5000 for queryable data views. The hasMoreResults field indicates if there are additional results beyond the count limit.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
dataViewID | Yes | ID of the data view to count results for. Must be a valid data view identifier that exists in the Pega system. Example: "D_Employees", "D_CustomerList" | |
dataViewParameters | No | Optional parameters for parameterized data views. Key-value pairs where keys are parameter names and values are parameter values. Example: {"CustomerID": "C-123", "Status": "Active"} | |
paging | No | Optional pagination configuration that affects count calculation. Can specify either maxResultsToFetch or pageNumber/pageSize combination, but not both. | |
query | No | Optional query configuration for filtering, aggregation, and field selection. Uses the same structure as get_list_data_view for consistency. |