HAP icon

HAP

Interact with HAP (Hyper Application Platform) API

Overview

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 include:

  • 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 relevant subsets.
  • Paginating large pivot results for efficient processing.

Example: A sales manager could use this node to get a pivot table showing total sales (values) by product categories (rows) and regions (columns), filtered to only include sales from the current quarter.

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": "region_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": "product_category"}].
Values JSON array specifying the 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": "sales_amount", "aggregation": "SUM"}].
Filter JSON object defining filter conditions applied before generating the pivot. Supports nested groups with AND/OR logic and conditions with operators such as eq, ne, gt, contains, between, isempty, etc. Filters must reference valid field IDs and follow specific rules for option fields, associated records, and time filtering. Example provided in the property description.
Sorts JSON array defining sort orders for the pivot data. Specifies which fields to sort by and the direction.
Page Size Number of records to return per page in the pivot result. Useful for paginating large datasets. Default is 100.
Page Index The page number to retrieve, starting at 1. Used together with Page Size for pagination.
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 pivot response. Defaults to true.

Output

The node outputs JSON data representing the pivot table result. The structure typically includes:

  • Pivot data arranged according to the specified rows and columns.
  • Aggregated values computed based on the configured value fields and aggregation functions.
  • Pagination metadata if applicable (page size, page index).
  • Optional summary row if requested.

If binary data were involved (not indicated here), it would represent file attachments or exports, but this node focuses on JSON pivot data.

Dependencies

  • Requires an API key credential for authenticating with the HAP API.
  • The node expects the HAP API endpoint to be accessible and properly configured.
  • No additional external dependencies beyond the HAP API and its authentication.

Troubleshooting

  • Invalid Worksheet ID: If the worksheet ID does not exist or is incorrect, the API will fail to retrieve data. Verify the worksheet ID is correct.
  • Malformed JSON Inputs: Properties like Columns, Rows, Values, Filter, and Sorts expect valid JSON arrays or objects. Invalid JSON syntax will cause errors.
  • Unsupported Operators in Filter: Only the specified 22 operators are supported. Using unsupported operators will cause failures.
  • Pagination Issues: Requesting a page index beyond available pages may return empty results.
  • API Authentication Errors: Ensure the API key credential is valid and has sufficient permissions.
  • Field IDs Must Exist: All referenced field IDs in Columns, Rows, Values, and Filter must exist in the worksheet's structure.

Links and References

Discussion