Hide Pivot Field Item in a Pivot Table – Aspose.Cells Cloud API Guide
Before calling the API, ensure you have:
- A valid JWT access token (obtainable via the Aspose Cloud authentication flow).
- The target workbook uploaded to your Aspose Cloud storage.
- The worksheet and pivot table already created.
These prerequisites prevent authentication errors and “resource not found” responses. The following steps outline the required setup before invoking the API.
This REST API hides a pivot field item in a pivot table.
PostPivotTableFieldHideItem API
POST https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/pivottables/{pivotTableIndex}/PivotField/Hide
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication.
Request parameters
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| name | string | path | Name of the Excel file. |
| sheetName | string | path | Worksheet that contains the pivot table. |
| pivotTableIndex | integer | path | Index of the pivot table within the worksheet. |
| pivotFieldType | string | query | Type of the pivot field (Row, Column, Page, Data, etc.). |
| fieldIndex | integer | query | Zero‑based index of the pivot field to modify. |
| itemIndex | integer | query | Index of the specific item within the field to hide. |
| isHide | boolean | query | Set to true to hide the item; false to show it. |
| needReCalculate | boolean | query | Indicates whether the pivot table should be recalculated after the change. Default is false. |
| folder | string | query | Folder path where the workbook is stored. |
| storageName | string | query | Name of the storage service. |
Quick reference of required query parameters
- pivotFieldType – type of the field (e.g.,
Row). - fieldIndex – zero‑based index of the field to modify.
- itemIndex – zero‑based index of the item to hide/show.
- isHide –
trueto hide,falseto show. - needReCalculate – optional, defaults to
false.
The OpenAPI Specification defines a publicly accessible programming interface and lets you perform REST interactions directly from a web browser.
You can use the cURL command‑line tool to access Aspose.Cells web services easily. The example below shows how to call the API with cURL.
Response details
| Status Code | Description |
|---|---|
| 200 | The item was hidden successfully. |
| 400 | Bad request – missing or invalid parameters. |
| 401 | Unauthorized – invalid or missing JWT token. |
| 500 | Server error – the operation could not be completed. |
Note: If the supplied fieldIndex or itemIndex is out of range, the API returns a 400 Bad Request response.
Cloud SDK Family
Using an SDK is the fastest way to develop against the API. SDKs handle low‑level details so you can focus on your business logic. See the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.
The following code examples demonstrate how to hide a pivot field item using various SDKs.
Note: The SDK examples assume that you have already configured authentication (JWT token) and that the workbook resides in the specified storage folder. Adjust the folder and storageName parameters as needed for your environment.