English 中文(简体)
Run Google Apps Script on Google-Spreadsheet event?
原标题:

If I create a Google apps script, can I hook it up to Google spreadsheet to run based on an event, or must I manually invoke it?

I don t know if Google Sheets supports any events.

For example: a Google app script that strikes out rows in the spreadsheet that have been marked completed by way of a column having the digit 1 beside completed rows. I would like this to run whenever a row is modified, or even when the spreadsheet is first loaded.

最佳回答

The function onOpen() is automatically executed every time a Spreadsheet is loaded. In the future, we will expose a general event API, but until then you can simply define your own function as long as it is called onOpen().
From the Section 2 of the Tutorial

There is also function onEdit() as can be viewed in at:

http://www.google.com/support/forum/p/apps-script/thread?tid=584a17c79e4c04d5&hl=en

It seems that event handling is in flux and dependent on security issues being worked out.

问题回答

暂无回答




相关问题
Using Aggregate Functions Inside a Trigger In MySQL

I have a People table with several attributes including age . Each time I insert a new tuple into this table, I would like to find out the average age of all the people listed in the table. If the ...

Mysql trigger/events vs Cronjob

I have an auction website which let my users place an unlimited amount of autobiddings. To monitor these autobiddings something has to check the database every second. My question is if it is ...

creation of trigger

I have this trigger procedure CASE_A as UPDATE table1 SET field1 = (SELECT bus FROM view1 WHERE table1.document = view1.document) end; the below trigger is supposed to execute the above ...

Inserting trigger (SQL 2005)

I have a temp table (question_desc, ans1, ans2, ans3, ans4, correct_ans, marks) with say 10 entries. From this table I have to insert values in two other tables: questions (q_id(auto-generated), ...

Before trigger in SQL Server

I have 2 tables: survey (id(PK), name) and survey_to_topic (survey_id(PK,FK,not null), topic_id(PK,FK,not null)). When I try to delete from survey table, I get exception: "The DELETE statement ...

Jquery mouseover/mouseout triggering inconsistently

I have two sortable lists, one being nested, with a mouse over effect on the li elements of the nested sortable list. My problem is that the mouseover and mouseout functions are being called ...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签