0

I'm newbie here... I've created a function to copy sprint data from my breakdown sheet. Everytime I call function on google spreadsheet, an error show up stating I need permission although I have given that function required permission on setting up trigger (the trigger I used is 'on form submit'). I'm still confused with triggers and functions like 'onEdit'&'onOpen' . Can anybody explain it to me, here's my function

    function Copy() {
      var copy=SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Breakdown");
      var paste=SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
      var row=copy.getLastRow();
       var d=7;
       for (var i=1;i<=row;i++)
        { if (copy.getRange(i,8).getValue() == "Sprint")
        {var c=copy.getRange(i,1).getValue();
         paste.getRange(d,1).setValue(c);
         c=copy.getRange(i,2).getValue();
         paste.getRange(d,2).setValue(c);
         c=copy.getRange(i,4).getValue();
         paste.getRange(d,3).setValue(c);
         c=copy.getRange(i,5).getValue();
         paste.getRange(d,4).setValue(c);
         c=copy.getRange(i,6).getValue();
         paste.getRange(d,5).setValue(c);
         d++;
           }
        }
     }
  • Please provide a spreadsheet link with sample data, desired output, and current output. You need to give permission to any function that runs SpreadsheetApp unless you run it through a simple or installed trigger. https://developers.google.com/apps-script/guides/triggers are you saying you already installed the trigger to your account which owns the spreadsheet? – CodeCamper Nov 18 '19 at 07:54
  • You may be interested in checking out the answer here: https://stackoverflow.com/questions/17992718/how-to-get-onformsubmit-to-trigger-automatically/17992883. Make sure that your `onFormSubmit` is installed properly, and also try testing the function you posted using the Google Apps Script IDE (see Google Apps Script - [Troubleshooting](https://developers.google.com/apps-script/guides/support/troubleshooting)). If after that you still have any issue kindly update your answer with the verbose message of it / a screenshot. Thanks – carlesgg97 Nov 18 '19 at 12:14

0 Answers0