Class Suggestions
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
הצעות
הצעות להשלמה אוטומטית כהשלמה לווידג'ט TextInput
.
התכונה זמינה בתוספים ל-Google Workspace ובאפליקציות של Google Chat.
const textInput = CardService.newTextInput().setSuggestions(
CardService.newSuggestions()
.addSuggestion('First suggestion')
.addSuggestion('Second suggestion'),
);
מסמכים מפורטים
addSuggestion(suggestion)
מוסיפים הצעה לטקסט.
פרמטרים
שם | סוג | תיאור |
suggestion | String | טקסט ההצעה. |
חזרה
Suggestions
– האובייקט הזה, לצורך קישור.
addSuggestions(suggestions)
הוספת רשימת הצעות לטקסט.
פרמטרים
שם | סוג | תיאור |
suggestions | Object[] | מערך של הצעות למחרוזות. |
חזרה
Suggestions
– האובייקט הזה, לצורך קישור.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון UTC)."],[[["\u003cp\u003eAutocomplete suggestions enhance TextInput widgets in Google Workspace Add-ons and Google Chat apps by providing users with pre-filled options.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can easily add single or multiple text suggestions using the \u003ccode\u003eaddSuggestion()\u003c/code\u003e and \u003ccode\u003eaddSuggestions()\u003c/code\u003e methods respectively, within the Suggestions object.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eaddSuggestion()\u003c/code\u003e method takes a single string argument representing the suggestion text, while \u003ccode\u003eaddSuggestions()\u003c/code\u003e accepts an array of strings for multiple suggestions.\u003c/p\u003e\n"],["\u003cp\u003eBoth methods return the Suggestions object, allowing for method chaining to efficiently build a comprehensive list of suggestions.\u003c/p\u003e\n"]]],[],null,["# Class Suggestions\n\nSuggestions\n\nAutocomplete suggestions to supplement a [TextInput](/apps-script/reference/card-service/text-input) widget.\n\nAvailable for Google Workspace add-ons and Google Chat apps.\n\n```javascript\nconst textInput = CardService.newTextInput().setSuggestions(\n CardService.newSuggestions()\n .addSuggestion('First suggestion')\n .addSuggestion('Second suggestion'),\n);\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|--------------------------------------------------------|------------------|---------------------------------|\n| [addSuggestion(suggestion)](#addSuggestion(String)) | [Suggestions](#) | Add a text suggestion. |\n| [addSuggestions(suggestions)](#addSuggestions(Object)) | [Suggestions](#) | Add a list of text suggestions. |\n\nDetailed documentation\n----------------------\n\n### `add``Suggestion(suggestion)`\n\nAdd a text suggestion.\n\n#### Parameters\n\n| Name | Type | Description |\n|--------------|----------|----------------------|\n| `suggestion` | `String` | The suggestion text. |\n\n#### Return\n\n\n[Suggestions](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `add``Suggestions(suggestions)`\n\nAdd a list of text suggestions.\n\n#### Parameters\n\n| Name | Type | Description |\n|---------------|------------|---------------------------------|\n| `suggestions` | `Object[]` | An array of string suggestions. |\n\n#### Return\n\n\n[Suggestions](#) --- This object, for chaining."]]