Suggestions

Autocomplete suggestions to supplement a `https://developers.google.com/apps-script/reference/card-service/text-input` widget.

Available for Google Workspace add-ons and Google Chat apps.

```javascript
const textInput = CardService.newTextInput().setSuggestions(
    CardService.newSuggestions()
        .addSuggestion('First suggestion')
        .addSuggestion('Second suggestion'),
);
```

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/card-service/suggestions#addSuggestion(String)` | `https://developers.google.com/apps-script/reference/card-service/suggestions#` | Add a text suggestion. |
| `https://developers.google.com/apps-script/reference/card-service/suggestions#addSuggestions(Object)` | `https://developers.google.com/apps-script/reference/card-service/suggestions#` | Add a list of text suggestions. |

## Detailed documentation

### `addSuggestion(suggestion)`

Add a text suggestion.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `suggestion` | `String` | The suggestion text. |

#### Return


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

*** ** * ** ***

### `addSuggestions(suggestions)`

Add a list of text suggestions.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `suggestions` | `Object[]` | An array of string suggestions. |

#### Return


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