Class Suggestions

  • Suggestions provide autocomplete suggestions for TextInput widgets in Google Workspace add-ons and Google Chat apps.

  • You can add individual text suggestions using addSuggestion(suggestion) or a list of text suggestions using addSuggestions(suggestions).

Suggestions

Autocomplete suggestions to supplement a TextInput widget.

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

consttextInput=CardService.newTextInput().setSuggestions(
CardService.newSuggestions()
.addSuggestion('First suggestion')
.addSuggestion('Second suggestion'),
);

Methods

MethodReturn typeBrief description
addSuggestion(suggestion) Suggestions Add a text suggestion.
addSuggestions(suggestions) Suggestions Add a list of text suggestions.

Detailed documentation

addSuggestion(suggestion)

Add a text suggestion.

Parameters

NameTypeDescription
suggestionStringThe suggestion text.

Return

Suggestions — This object, for chaining.


addSuggestions(suggestions)

Add a list of text suggestions.

Parameters

NameTypeDescription
suggestionsObject[]An array of string suggestions.

Return

Suggestions — This object, for chaining.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年01月30日 UTC.