Enum EventType
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ประเภทเหตุการณ์
การแจกแจงที่ระบุประเภทของเหตุการณ์ที่ทริกเกอร์
หากต้องการเรียกใช้ enum ให้เรียกคลาสหลัก ชื่อ และพร็อพเพอร์ตี้ของ enum นั้น เช่น
ScriptApp.EventType.CLOCK
พร็อพเพอร์ตี้
พร็อพเพอร์ตี้ | ประเภท | คำอธิบาย |
CLOCK | Enum | ทริกเกอร์จะทํางานเมื่อเหตุการณ์ที่กําหนดเวลาถึงเวลาที่ต้องการ |
ON_OPEN | Enum | ทริกเกอร์จะทํางานเมื่อผู้ใช้เปิดไฟล์ Google เอกสาร, ชีต หรือฟอร์ม |
ON_EDIT | Enum | ทริกเกอร์จะทํางานเมื่อผู้ใช้แก้ไขไฟล์ Google ชีต (เช่น โดยการป้อนค่าใหม่ลงในเซลล์ ซึ่งจะนับเป็นการแก้ไขแทนการเปลี่ยนแปลง) |
ON_FORM_SUBMIT | Enum | ทริกเกอร์จะทํางานเมื่อผู้ใช้ตอบ Google Forms ทริกเกอร์นี้ใช้ได้ทั้งใน Google ฟอร์มเองหรือในไฟล์ Google ชีตที่แบบฟอร์มส่งคำตอบไป |
ON_CHANGE | Enum | ทริกเกอร์จะทํางานเมื่อผู้ใช้เปลี่ยนแปลงไฟล์ Google ชีต (เช่น การเพิ่มแถว ซึ่งจะนับเป็นการเปลี่ยนแปลงแทนการแก้ไข) |
ON_EVENT_UPDATED | Enum | ทริกเกอร์จะทำงานเมื่อมีการสร้าง อัปเดต หรือลบกิจกรรมใน Google ปฏิทินที่ระบุ |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003e\u003ccode\u003eEventType\u003c/code\u003e is an enumeration used to define the type of event that triggers a script to run.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eEventType\u003c/code\u003e enum includes properties such as \u003ccode\u003eCLOCK\u003c/code\u003e, \u003ccode\u003eON_OPEN\u003c/code\u003e, \u003ccode\u003eON_EDIT\u003c/code\u003e, \u003ccode\u003eON_FORM_SUBMIT\u003c/code\u003e, \u003ccode\u003eON_CHANGE\u003c/code\u003e, and \u003ccode\u003eON_EVENT_UPDATED\u003c/code\u003e, each corresponding to a specific event trigger.\u003c/p\u003e\n"],["\u003cp\u003eTo call an enum property, use the syntax \u003ccode\u003eScriptApp.EventType.PROPERTY_NAME\u003c/code\u003e, replacing \u003ccode\u003ePROPERTY_NAME\u003c/code\u003e with the desired event type (e.g., \u003ccode\u003eScriptApp.EventType.CLOCK\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThese event triggers allow scripts to automatically execute in response to various actions within Google Apps like Docs, Sheets, Forms, and Calendar.\u003c/p\u003e\n"]]],[],null,["# Enum EventType\n\nEventType\n\nAn enumeration denoting the type of triggered event.\n\nTo call an enum, you call its parent class, name, and property. For example, `\nScriptApp.EventType.CLOCK`. \n\n### Properties\n\n| Property | Type | Description |\n|--------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `CLOCK` | `Enum` | The trigger fires once the time-driven event reaches a specific time. |\n| `ON_OPEN` | `Enum` | The trigger fires once the user opens the Google Docs, Sheets, or Forms file. |\n| `ON_EDIT` | `Enum` | The trigger fires once the user edits the Google Sheets file (for example, by entering a new value into a cell, which counts as an edit instead of a change). |\n| `ON_FORM_SUBMIT` | `Enum` | The trigger fires once the user responds to a Google Form. This trigger is available either in the Google Form itself or in the Google Sheets file that the form sends its responses to. |\n| `ON_CHANGE` | `Enum` | The trigger fires once the user changes the Google Sheets file (for example, by adding a row, which counts as a change instead of an edit). |\n| `ON_EVENT_UPDATED` | `Enum` | The trigger fires once an event gets created, updated, or deleted on the specified Google Calendar. |"]]