Class SuggestionsResponse
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
VorschlägeAntwort
Ein Antwortobjekt, das von einer Callback-Funktion für Vorschläge zurückgegeben werden kann. Wird für TextInput
-Widgets verwendet, die die automatische Vervollständigung implementieren.
Verfügbar für Google Workspace-Add-ons und Google Chat-Apps.
const suggestionsResponse = CardService.newSuggestionsResponseBuilder()
.setSuggestions(
CardService.newSuggestions()
.addSuggestion('First suggestion')
.addSuggestion('Second suggestion'),
)
.build();
Methoden
Methode | Rückgabetyp | Kurzbeschreibung |
printJson() | String | Die JSON-Darstellung dieses Objekts wird ausgegeben. |
Detaillierte Dokumentation
printJson()
Die JSON-Darstellung dieses Objekts wird ausgegeben. Diese Option ist nur für die Fehlerbehebung gedacht.
Rückflug
String
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-26 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-07-26 (UTC)."],[[["\u003cp\u003e\u003ccode\u003eSuggestionsResponse\u003c/code\u003e objects, used with \u003ccode\u003eTextInput\u003c/code\u003e widgets for autocomplete, facilitate suggestions within Google Workspace Add-ons and Google Chat apps.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can leverage the \u003ccode\u003eSuggestionsResponseBuilder\u003c/code\u003e to construct a response containing suggestions using methods like \u003ccode\u003esetSuggestions\u003c/code\u003e and \u003ccode\u003eaddSuggestion\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eFor debugging purposes, the \u003ccode\u003eprintJson()\u003c/code\u003e method outputs the JSON structure of the \u003ccode\u003eSuggestionsResponse\u003c/code\u003e object.\u003c/p\u003e\n"]]],[],null,["# Class SuggestionsResponse\n\nSuggestionsResponse\n\nA response object that can be returned from a suggestions callback function. This is used with\n[TextInput](/apps-script/reference/card-service/text-input) widgets that implement autocomplete.\n\nAvailable for Google Workspace add-ons and Google Chat apps.\n\n```javascript\nconst suggestionsResponse = CardService.newSuggestionsResponseBuilder()\n .setSuggestions(\n CardService.newSuggestions()\n .addSuggestion('First suggestion')\n .addSuggestion('Second suggestion'),\n )\n .build();\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|-----------------------------|-------------|------------------------------------------------|\n| [printJson()](#printJson()) | `String` | Prints the JSON representation of this object. |\n\nDetailed documentation\n----------------------\n\n### `print``Json()`\n\nPrints the JSON representation of this object. This is for debugging only.\n\n#### Return\n\n\n`String`"]]