Add a Pivot Field to a Pivot Table – Aspose.Cells Cloud Documentation

This REST API adds a pivot field to an existing pivot table.

Prerequisite: To call this endpoint you must include a valid JWT authentication token in the Authorization header and ensure the workbook is stored in the specified folder or default storage.

REST API

PUT https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/pivottables/{pivotTableIndex}/PivotField

Request parameters

Parameter Name Type Location Description
name string path Document name.
sheetName string path Worksheet name.
pivotTableIndex integer path Index of the pivot table.
pivotFieldType string query Type of the fields area (e.g., Row, Column).
request object body DTO that contains the field indexes to add.
needReCalculate boolean query Set to true to recalculate the pivot table after the operation.
folder string query Folder where the document is stored.
storageName string query Name of the storage.

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 call Aspose.Cells web services. The example below demonstrates how to add a pivot field using cURL.

The successful response returns a JSON object with Code and Status fields. Example schema:

{
  "Code": 0,        // integer indicating the HTTP status code
  "Status": "OK"    // string message
}

Possible error responses include 400 Bad Request for missing parameters, 401 Unauthorized if the token is invalid, and 500 Internal Server Error for server‑side issues.

Cloud SDK Family

Using an SDK is the fastest way to integrate this functionality. SDKs handle low‑level details, allowing you to 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 call Aspose.Cells web services using various SDKs:

See also: