I have three Google Script functions in a Google Document (we'll call them functionOne, functionTwo and functionThree). What I would like to do is create a new function (we'll call it newFunction) that will run every Friday at 7 am using triggers (this part I know how to do).

What I am having a hard time with is I would like newFunction to call one of functionOne, functionTwo or functionThree in a specific order.

For example, the first Friday, I want functionOne ran, the next Friday functionTwo, the third Friday functionThree and then loop.

How would I be able to accomplish this?

Thanks in advance.

1 Answer 1


May be you need something like this

function newFunction() {
  var order =
    PropertiesService.getScriptProperties().getProperty('order') || '1';
  switch (order) {
    case '1':
    case '2':
    case '3':
  var nextOrder = '' + (+order < 3 ? +order + 1 : '1');
  PropertiesService.getScriptProperties().setProperty('order', nextOrder);

You can use an external properties store for save the current state of the app. As you can see there is no need to specified a week day.

  • Hey contributorpw, thanks for the help. When I put the above code in and try to run the function, it runs without any errors, but it does not do what I would expect it to. functionOne, functionTwo or functionThree does not run.
    – Ryan
    Sep 3, 2019 at 15:16
  • @Ryan Sorry this is my fault. It's fixed now. See var order = ...
    – oshliaer
    Sep 3, 2019 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.