Actions31
- Option Set Actions
- Public Query Actions
- Record Actions
- Role Actions
- Workflow Actions
- Worksheet Actions
Record → Get Pivot
AI-generatedOverview
This node interacts with the HAP (Hyper Application Platform) API to retrieve pivot table data from a specified worksheet. It allows users to configure pivot table parameters such as columns, rows, values, filters, sorting, pagination, and view filters. This is useful for summarizing and analyzing large datasets by aggregating data dynamically in a pivot format.
Common scenarios:
- Generating summarized reports from raw data stored in worksheets.
- Creating dynamic dashboards that require pivoted data views.
- Filtering and sorting data before aggregation to focus on specific segments.
- Paginating large pivot results for efficient processing or display.
Practical example:
A sales manager wants to see total sales (SUM of sales amount) grouped by region (rows) and product category (columns), filtered to only include sales from the current quarter, sorted by total sales descending, and paginated to show 100 records per page.
Properties
| Name | Meaning |
|---|---|
| Worksheet ID | The unique identifier of the worksheet from which to retrieve pivot data. |
| Columns | JSON array specifying the column fields for the pivot table. Each item defines a field to be used as a column header in the pivot. Example: [{"field": "field_id"}]. |
| Rows | JSON array specifying the row fields for the pivot table. Each item defines a field to be used as a row header in the pivot. Example: [{"field": "field_id"}]. |
| Values | JSON array specifying value fields and their aggregation methods for the pivot table. Each item includes a field and an aggregation function like SUM, COUNT, etc. Example: [{"field": "field_id", "aggregation": "SUM"}]. |
| Filter | JSON object defining filter conditions applied before pivoting. Supports nested groups with AND/OR logic and conditions with operators such as eq, ne, gt, contains, between, isempty, etc. Filters use field IDs and support complex logical expressions up to two levels deep. Example: {"type": "group", "logic": "AND", "children": [{"type": "condition", "field": "department_name", "operator": "contains", "value": ["Sales"]}]}. |
| Sorts | JSON array defining sort conditions for the pivot data. Specifies fields and sort directions to order the pivot results. |
| Page Size | Number of records to return per page when paginating pivot results. Default is 100. |
| Page Index | Page number to retrieve, starting from 1. Used for paginating pivot results. |
| View ID | Optional view identifier to apply predefined view filters on the worksheet data before pivoting. |
| Include Summary | Boolean flag indicating whether to include a summary row in the response, typically aggregating totals or averages. Defaults to true. |
Output
The node outputs JSON data representing the pivot table result based on the configured parameters. The structure typically includes:
- Pivoted data rows with aggregated values according to the specified rows, columns, and values.
- Pagination metadata if applicable (page size, page index).
- Optional summary row if enabled.
- The output does not explicitly mention binary data, so it is assumed to be purely JSON structured data.
Dependencies
- Requires connection to the HAP (Hyper Application Platform) API.
- Needs an API authentication token credential configured in n8n to authorize requests.
- The node sends and receives JSON-formatted data over HTTP with appropriate headers (
Accept: application/json,Content-Type: application/json).
Troubleshooting
- Invalid Worksheet ID: If the worksheet ID is incorrect or does not exist, the API will likely return an error. Verify the worksheet ID is correct and accessible.
- Malformed JSON in Columns/Rows/Values/Filter: These properties expect valid JSON arrays or objects. Invalid JSON syntax will cause errors. Use proper JSON formatting.
- Unsupported Operators in Filter: Only 22 specific operators are supported. Using unsupported operators will cause failures. Refer to the allowed operator list.
- Pagination Issues: Requesting a page index beyond available pages may return empty results. Adjust page size or index accordingly.
- Authentication Errors: Missing or invalid API credentials will prevent successful API calls. Ensure the API key/token is correctly set up in n8n.
- Large Data Sets: Retrieving very large pivot tables may lead to timeouts or performance issues. Use filtering and pagination to limit data volume.
Links and References
- HAP (Hyper Application Platform) API Documentation (Replace with actual URL if available)
- Pivot Table Concepts
- JSON Filtering and Query Operators
Note: The above summary is based solely on static analysis of the provided source code and property definitions.