Navigation

A helper object that controls card navigation. See the [card navigation guide](https://developers.google.com/gmail/add-ons/how-tos/navigation) for more details.

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/card-service/navigation#popCard()` | `https://developers.google.com/apps-script/reference/card-service/navigation#` | Pops a card from the navigation stack. |
| `https://developers.google.com/apps-script/reference/card-service/navigation#popToNamedCard(String)` | `https://developers.google.com/apps-script/reference/card-service/navigation#` | Pops to the specified card by its card name. |
| `https://developers.google.com/apps-script/reference/card-service/navigation#popToRoot()` | `https://developers.google.com/apps-script/reference/card-service/navigation#` | Pops the card stack to the root card. |
| `https://developers.google.com/apps-script/reference/card-service/navigation#printJson()` | `String` | Prints the JSON representation of this object. |
| `https://developers.google.com/apps-script/reference/card-service/navigation#pushCard(Card)` | `https://developers.google.com/apps-script/reference/card-service/navigation#` | Pushes the given card onto the stack. |
| `https://developers.google.com/apps-script/reference/card-service/navigation#updateCard(Card)` | `https://developers.google.com/apps-script/reference/card-service/navigation#` | Does an in-place replacement of the current card. |

## Detailed documentation

### `popCard()`

Pops a card from the navigation stack. Can be chained with other card navigation actions.

#### Return


`https://developers.google.com/apps-script/reference/card-service/navigation#` --- This object, for chaining.

*** ** * ** ***

### `popToNamedCard(cardName)`

Pops to the specified card by its card name. Can be chained with other card navigation actions.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `cardName` | `String` | The name of the card to navigate to. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/navigation#` --- This object, for chaining.

*** ** * ** ***

### `popToRoot()`

Pops the card stack to the root card. Can be chained with other card navigation actions.

#### Return


`https://developers.google.com/apps-script/reference/card-service/navigation#` --- This object, for chaining.

*** ** * ** ***

### `printJson()`

Prints the JSON representation of this object. This is for debugging only.

#### Return


`String`

*** ** * ** ***

### `pushCard(card)`

Pushes the given card onto the stack. Can be chained with other card navigation actions.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `card` | `https://developers.google.com/apps-script/reference/card-service/card` | A card to add to the stack. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/navigation#` --- This object, for chaining.

*** ** * ** ***

### `updateCard(card)`

Does an in-place replacement of the current card. Can be chained with other card navigation
actions.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `card` | `https://developers.google.com/apps-script/reference/card-service/card` | A card to replace the current card with. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/navigation#` --- This object, for chaining.