
## PivotFieldCollection class

Represents a collection of all the PivotField objects in the PivotTable's specific PivotFields type.

## Methods

| Name | Description |
| --- | --- |
| [add(pivotField)](#add) | Adds a PivotField Object to the specific type PivotFields. |
| [addByBaseIndex(baseFieldIndex)](#addbybaseindex) | Adds a PivotField Object to the specific type PivotFields. |
| [clear()](#clear) | clear all fields of PivotFieldCollection |
| [get()](#get) | Gets the PivotField Object at the specific index. |
| [get()](#get-1) | Gets the PivotField Object of the specific name. |
| [getCount()](#getcount) | Gets the count of the pivotFields. |
| [getType()](#gettype) | Gets the PivotFields type. The value of the property is PivotFieldType integer constant. |
| [iterator()](#iterator) | Gets an enumerator over the elements in this collection in proper sequence. |
| [move(currPos, destPos)](#move) | Moves the PivotField from current position to destination position |

### add(pivotField) {#add}

Adds a PivotField Object to the specific type PivotFields.

| Parameter | Type | Description |
| --- | --- | --- |
| pivotField | PivotField | a PivotField Object. |

**Returns:** Number — `Number` the index of the PivotField Object in this PivotFields.

### addByBaseIndex(baseFieldIndex) {#addbybaseindex}

Adds a PivotField Object to the specific type PivotFields.

| Parameter | Type | Description |
| --- | --- | --- |
| baseFieldIndex | Number | field index in the base PivotFields. |

**Returns:** Number — `Number` the index of the PivotField Object in this PivotFields.

### clear() {#clear}

clear all fields of PivotFieldCollection

### get() {#get}

Gets the PivotField Object at the specific index.

### get() {#get-1}

Gets the PivotField Object of the specific name.

### getCount() {#getcount}

Gets the count of the pivotFields.

### getType() {#gettype}

Gets the PivotFields type. The value of the property is PivotFieldType integer constant.

### iterator() {#iterator}

Gets an enumerator over the elements in this collection in proper sequence.

**Returns:** Iterator — `Iterator` enumerator

### move(currPos, destPos) {#move}

Moves the PivotField from current position to destination position

| Parameter | Type | Description |
| --- | --- | --- |
| currPos | Number | Current position of PivotField based on zero |
| destPos | Number | Destination position of PivotField based on zero |
