A
A
Andrey2020-08-20 18:35:19
Google Sheets
Andrey, 2020-08-20 18:35:19

Where is the error in the script? Why does the script "swear"?

Good day!

I automate the creation of events in the calendar from the table. Here is the code:

spoiler
function SynsToCalendar() {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheetByName("CALENDAR");
  var lr = sheet.getLastRow();
  
  


  var spreadsheet = SpreadsheetApp.getActiveSheet();
  var calendarId = spreadsheet.getRange('E4').getValue();
    if(sheet.geRange(10, 10).isChecked()===true){  
    
  var eventCal = CalendarApp.getCalendarById(calendarId);
  var lr = spreadsheet.getLastRow();var count = spreadsheet.getRange("A8:F"+lr+"").getValues();
    
 
    for (x=0; x<count.length; x++) {
          var shift = count[x];
      
      var summary = shift[0];
      var startTime = shift[1];
      var endTime = shift[2];
      var guests = shift[3];
      var description = shift[4];
      var location = shift[5]; 
  
      var event = {
          'location': location,
          'description': description,
          'guests':guests +',',
          'sendInvites': 'True',
  
      }
eventCal.createEvent(summary, startTime, endTime, event);
 
sheet.getRange(10, 10).uncheck(); 
    }
  }
};

A trigger to change the table has been created... The idea is that a checkbox is set from the phone that launches the script (example: https://www.youtube.com/watch?v=BeBOtMuEGlA ), but the script does not start the checkbox, the trigger works with an error , and the script itself works, but also swears at the signature mismatch.

The table is built like this ( https://www.machinelearningmastery.ru/creating-cal... )

5f3e98236eea9981604961.jpeg

5f3e982e4078b911898985.jpeg

Please help me correct the errors. You can't do it without professionals. (((

Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Grigory Boev, 2020-08-20
@ProgrammerForever

Judging by the log, it is obvious: sheet.ge t Range

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question