Class SpreadsheetTriggerBuilder
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
SpreadsheetTriggerBuilder
הכלי ליצירת טריגרים של גיליונות אלקטרוניים.
מסמכים מפורטים
create()
יצירת הטריגר והחזרתו.
חזרה
Trigger
– הטריגר שנוצר.
onChange()
יצירת טריגר שיופעל כשהתוכן או המבנה של הגיליון האלקטרוני ישתנו.
const sheet = SpreadsheetApp.getActive();
ScriptApp.newTrigger('myFunction').forSpreadsheet(sheet).onChange().create();
חזרה
SpreadsheetTriggerBuilder
– כלי build לשרשור
onEdit()
טריגר שיופעל כשהגיליון האלקטרוני יערך.
const sheet = SpreadsheetApp.getActive();
ScriptApp.newTrigger('myFunction').forSpreadsheet(sheet).onEdit().create();
חזרה
SpreadsheetTriggerBuilder
– כלי build לשרשור
onOpen()
טריגר שיופעל כשהגיליון האלקטרוני ייפתח.
const sheet = SpreadsheetApp.getActive();
ScriptApp.newTrigger('myFunction').forSpreadsheet(sheet).onOpen().create();
חזרה
SpreadsheetTriggerBuilder
– כלי build לשרשור
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון UTC)."],[[["\u003cp\u003eSpreadsheetTriggerBuilder facilitates the creation and customization of triggers specific to Google Spreadsheets.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods to set triggers for various events, such as changes in content or structure (\u003ccode\u003eonChange()\u003c/code\u003e), edits (\u003ccode\u003eonEdit()\u003c/code\u003e), form submissions (\u003ccode\u003eonFormSubmit()\u003c/code\u003e), and spreadsheet opening (\u003ccode\u003eonOpen()\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eEach trigger specification method returns a builder object, enabling chained configurations for flexibility and conciseness in trigger setup.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecreate()\u003c/code\u003e method finalizes the trigger definition and returns a Trigger object, instantiating the trigger for execution based on the specified event.\u003c/p\u003e\n"]]],[],null,["# Class SpreadsheetTriggerBuilder\n\nSpreadsheetTriggerBuilder\n\nBuilder for spreadsheet triggers. \n\n### Methods\n\n| Method | Return type | Brief description |\n|-----------------------------------|--------------------------------------------------|--------------------------------------------------------------------------------------------|\n| [create()](#create()) | [Trigger](/apps-script/reference/script/trigger) | Creates the trigger and returns it. |\n| [onChange()](#onChange()) | [SpreadsheetTriggerBuilder](#) | Specifies a trigger that will fire when the spreadsheet's content or structure is changed. |\n| [onEdit()](#onEdit()) | [SpreadsheetTriggerBuilder](#) | Specifies a trigger that will fire when the spreadsheet is edited. |\n| [onFormSubmit()](#onFormSubmit()) | [SpreadsheetTriggerBuilder](#) | Specifies a trigger that will fire when the spreadsheet has a form submitted to it. |\n| [onOpen()](#onOpen()) | [SpreadsheetTriggerBuilder](#) | Specifies a trigger that will fire when the spreadsheet is opened. |\n\nDetailed documentation\n----------------------\n\n### `create()`\n\nCreates the trigger and returns it.\n\n#### Return\n\n\n[Trigger](/apps-script/reference/script/trigger) --- The created trigger.\n\n*** ** * ** ***\n\n### `on``Change()`\n\nSpecifies a trigger that will fire when the spreadsheet's content or structure is changed.\n\n```javascript\nconst sheet = SpreadsheetApp.getActive();\nScriptApp.newTrigger('myFunction').forSpreadsheet(sheet).onChange().create();\n```\n\n#### Return\n\n\n[SpreadsheetTriggerBuilder](#) --- a builder for chaining\n\n*** ** * ** ***\n\n### `on``Edit()`\n\nSpecifies a trigger that will fire when the spreadsheet is edited.\n\n```javascript\nconst sheet = SpreadsheetApp.getActive();\nScriptApp.newTrigger('myFunction').forSpreadsheet(sheet).onEdit().create();\n```\n\n#### Return\n\n\n[SpreadsheetTriggerBuilder](#) --- a builder for chaining\n\n*** ** * ** ***\n\n### `on``Form``Submit()`\n\nSpecifies a trigger that will fire when the spreadsheet has a form submitted to it.\n\n```javascript\nconst sheet = SpreadsheetApp.getActive();\nScriptApp.newTrigger('myFunction')\n .forSpreadsheet(sheet)\n .onFormSubmit()\n .create();\n```\n\n#### Return\n\n\n[SpreadsheetTriggerBuilder](#) --- A builder for chaining.\n\n*** ** * ** ***\n\n### `on``Open()`\n\nSpecifies a trigger that will fire when the spreadsheet is opened.\n\n```javascript\nconst sheet = SpreadsheetApp.getActive();\nScriptApp.newTrigger('myFunction').forSpreadsheet(sheet).onOpen().create();\n```\n\n#### Return\n\n\n[SpreadsheetTriggerBuilder](#) --- a builder for chaining"]]