query_view
Queries records from a Caspio view. Views are predefined data sources that can filter a single table or join multiple tables. The query syntax is identical to querying tables -- the backend supports Microsoft SQL Server WHERE syntax (LIKE, AND, OR, NOT, IN, BETWEEN, comparison operators, etc.). Returns a JSON object with a 'records' array of flat key-value objects where keys are field names, and optional 'pagination' metadata when getPaginationInfo is true. Maximum 1000 records per request (default 100). For larger result sets, use pageNumber and pageSize to paginate. IMPORTANT: field names are case-insensitive and must come from discover_views' field list -- never guess a field name from its label or from naming conventions. Call discover_views first for any view not already discovered earlier in this conversation to get its viewId.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of records returned (skipped when pageNumber or pageSize is not empty, max = 1000, default = 100). | |
| where | No | WHERE clause. Examples: 'YesNoBoolField=1'; 'NumField=123 AND (StrField=N'Abc' OR DateField<='2001-01-31 23:59:59')'; 'Name = N'O''Brien'' (N prefix denotes Unicode, use '' to escape single quotes)' | |
| select | Yes | SELECT field list (required). Use '*' to return all fields (safe default). Examples: ''*; 'PK_ID'; 'Field1, Field2'; 'COUNT(*) as Total' | |
| viewId | Yes | View Id (obtained from discover_views, e.g. 'v12345') -- the view's name has no meaning for API calls; only the Id can be used here. | |
| groupBy | No | GROUP BY clause. Use when grouping results by specific fields with aggregate functions. Examples: 'PK_ID', 'Field1, Field2' | |
| orderBy | No | ORDER BY clause. Examples: 'PK_ID', 'Field1 ASC, Field2 DESC' | |
| pageSize | No | Number of records per page (possible values from 5 to 1000, default = 25) | |
| pageNumber | No | Page number (default = 1) | |
| getPaginationInfo | No | Return pagination info (total_count, page_size, page_number) in a 'pagination' object. Default is false. |