Office Script; Excel online; Pivot Table; DataHierarchy field title

Jenny Charlton 0 Reputation points
2023-02-10T20:28:16.0866667+00:00

I would like to change the title for a Pivot Table DataHierarchy field. I cannot find any documentation. Specifically, I'd like to change the field name from "Sum of aDate" to "aDate" I'm using Office Script/Java Script. I tried recording the task but the script uses hard coded reference

/*function main(workbook: ExcelScript.Workbook) {
	let selectedSheet = workbook.getActiveWorksheet();
	// Set range H9 on selectedSheet
	selectedSheet.getRange("H9").setValue(" 25Jul22");
}*/

thank you

Jenny

Office
Office
A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.
1,436 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,654 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,686 questions
{count} votes