Add an event to a Google Calendar using Google Apps Script

Поделиться
HTML-код
  • Опубликовано: 3 дек 2024

Комментарии • 8

  • @BarryIsFunny
    @BarryIsFunny 10 месяцев назад +1

    This was great. Easy to follow and really well done. Thank you!

  • @abdullahquhtani4247
    @abdullahquhtani4247 2 года назад +2

    Excellent ! That will be GREAT if you make that dynamic for example I have a time table in excel sheet for certain days of the week and each event duration also would be customized (15 min, 39 min. etc) and I let students book a meeting through google form for example. One more important thing, there should not be duplicated events and that can be solved by eliminating booked slots from the time table in the sheet so students can book from left available slots. Thank you.
    BTW, do you do paid freelance tasks like this?!
    Thank you.

    • @yagisanatode
      @yagisanatode  2 года назад +1

      Great use case. I'm sure other viewers will draw some inspiration from it.
      Yes, I do consult, but am currently booked out until the new year.

  • @kurteades6797
    @kurteades6797 2 года назад +1

    Best tutorial I have found, due to the ease of explanation and simplicity. You used understandable commands, many use commands and script language I have to go research to figure out. Thank you very much for this!
    How easy would it be to extract the event data from the last row of a gsheet?
    I have an appsheet which adds the calendar data to a gsheet... but so I don't get duplicates, I would need to only add the last row each time and event was created.

    • @yagisanatode
      @yagisanatode  2 года назад

      Hi Kurt, Thanks for the kind words. You could use a custom onChange trigger to do this and extract the last row with something like this:
      function lastRow(){
      const URL = ""
      const SheetName = ""
      const ss = SpreadsheetApp.openByUrl(URL)
      const sheet = ss.getSheetByName(SheetName)
      const lastRow = sheet.getActiveRangeList() // Gets the last row with data in it.
      return sheet.getRange(`${lastRow}:${lastRow}`).getValues() // you can change this to include a column range e.g. `$A{lastRow}:K${lastRow}`
      }
      developers.google.com/apps-script/guides/triggers
      Alternatively, you could make it part of the workflow for your AppSheet project with some apps script, but the setup is currently a little bit trickier. support.google.com/appsheet/answer/11997142?hl=en

  • @servirguidebook
    @servirguidebook 11 месяцев назад

    I have several events that are are one day - but we don't specify the time. As a result I get
    Exception: Event start date must be before event end date. How can I work around that?

    • @yagisanatode
      @yagisanatode  11 месяцев назад

      Hmm. I'm not too sure what is occurring for you without seeing a sample of your code. How are you iterating over the events that you are creating?