Another question about syncing/exporting google sheets to google calendar. Can you make a video about how to include the colors from google sheets into the calendar? As an example if you have a series of events in google sheets that you want to import into calendar and have them highlighted the same color in calendar as they are in sheets. Thanks as always for your videos!!
@rmu19854 жыл бұрын
Hello, you videos are really helping us in learning google sheets. Keep them coming and you are doing a great job. Can you do a video on integrating Google tasks Api? Breaking talking for another Google ID and getting the status of tasks and updating the task status in sheet?
@consultingsupport10965 жыл бұрын
Love your presentation of app script. I enjoy much how faster things work. Is there a way to add events to multiple calendars?
@allinoneallinone32336 жыл бұрын
Hi guys, Love your videos. Can you please update this one and see it is possible to invite some "guest" to a particular event, so all of the participants can receive a notification alerts regarding the event (let's say 5 min before it)?
@stevenboss38134 жыл бұрын
Fantastic and thank you, great presentation. Please can I ask, on your last line "description: data[i][4]});" is there a way of including a description from a 6th column in sheets?
@diegodelfino94092 жыл бұрын
how you prevent the script to duplicate the events already added to the calendar. let's say I add another event to the excel file and rerun the script, it will duplicate all the previous entries. thanks
@wakeyourdata28126 жыл бұрын
Your videos are amazing!!! We use a Google Form for our managers to submit events to be added to our calendars. There are 60 calendars. Is there a way to add in some logic to what you demonstrated so that if certain fields contain certain text it will populate the event to the appropriate calendar? (i.e., If the Marketing column is Yes and the store field contains the word Chicago then the event will populate to the Chicago Marketing calendar?) If not, is there a way to write the macro so that it distributes the events to the appropriate sheet in the worksheet then we can use Zapier to populate the calendars. I'd prefer to avoid using Zapier.
@ExcelGoogleSheets6 жыл бұрын
The short answer is yes.
@markuswinter-cdps30082 жыл бұрын
Thanks, as always for your videos!! Can I request that you do a video, not so much for events, but for scheduling. We use google sheets for scheduling, and rather than duplicating efforts (and manually entering the schedule into Google Calendar), it would be great to be able to export it. And if you are able to, can you include days off. Reason that I ask is because I've run into the error where will not execute if it's a string (text), rather than date/time (value). To try to get around this, I used if([cell reference]="off", 0...but I'm sure there's a better way than using 12/30/1899 :D. Thanks again!!
@tonyparini3 жыл бұрын
Nice video! However: is it possible to do the same thing using different calendars?
@abdullahquhtani42474 жыл бұрын
Hi. I hope you REPLY :-) That’s great put you missed something. What will happen when new events added if for example is connected to google forms! What will happen in this case? Will the script delete the previous ones or overwrite them? shouldn’t be there if condition to add only new added event based on a field to be changed after the script add the event to the calendar? It’s a good point to be considered. Thank you.
@johanvandervorst7 жыл бұрын
Can you please add a video where you explain how to update the events in the calendar from the sheet?!
@elbiju6 жыл бұрын
hello, did you now how to update the events ?
@rogeriolimacarneiro30686 жыл бұрын
@@elbiju you can run this code and, so, create a trigger to run each min.
@derekherzog15695 жыл бұрын
you could just pair this with the deleteEvent() method to effectively do the same thing
@krisannespedillon75335 жыл бұрын
How can I add the addGuest?
@Nika-cp9ll6 ай бұрын
if I change the date or time in google sheets, will it be automatically updated in google calendar?
@golammusabbir9145 жыл бұрын
Hi.. I love your training. it makes me smarter. i m very much thankful to your effort that you are giving to us. In this script can u help us to avoid duplicate event and/or deleting any event
@gum32132 жыл бұрын
did you fixed this problem?
@khatushyamunitedpacking24684 жыл бұрын
dear sir, when we are run this code , then error occur this , (Exception: The parameters (String,String,String,(class)) don't matchthe method signature for CalendarApp.Calendar.createEvent. (line 48, file "Code")) please needs to help for same.
@pablomoralestorricos94334 жыл бұрын
same problem, did you solve it?
@kimberlyonza81214 жыл бұрын
Thank you so much!!
@BluechipJunior7 жыл бұрын
Would you consider posting the code itself so we may copy and paste? I know I am being very lazy! PS- Thank you so very much for your amazing tutorials!!! I have utilized them.
@gringotaxis22964 жыл бұрын
These are a great series of videos! However I'm getting a SyntaxError: Unexpected end of input on the last line. Any help on figuring this out would be great
@henryvongsavath17064 жыл бұрын
Post a link to your code, maybe I can help you out.
@ИльяСултанов4 жыл бұрын
@@henryvongsavath1706 function event() { let ss = SpreadsheetApp.getActiveSpreadsheet(), DbCalendar = ss.getSheetByName('DbCalendar'), shedule = ss.getSheetByName('shedule'), shows = ss.getSheetByName('shows'), stuff = ss.getSheetByName('stuff'), calendarId = stuff.getRange('H2').getValue(), eventCal = CalendarApp.getCalendarById(calendarId); let lr = DbCalendar.getLastRow(), lc = DbCalendar.getLastColumn(); let data = DbCalendar.getRange(1, 1, lr, lc).getValues(); for(i = 0; i
@Stirlinggorilla3 жыл бұрын
How can I add events that repeat weekly/monthly depending on information in the google sheet
@jenniferradcliffe90854 жыл бұрын
how do you add events that are a combination of all day events and specific time events?
@ishanharshvardhan66873 жыл бұрын
is it possible to automatically sync a sheet to calender as rows get added
@yo_swarnali4 жыл бұрын
This code is for one calendar(or one gmail account) only. What if I want/need for more than one gmail ids? Means, I want to send calender events to many people.
@nhatkhiemlai36503 жыл бұрын
Why my function show Cannot read property 'getTitle' of undefined?
@wongkinwah10523 жыл бұрын
I started learn your videos tutorial from Google Sheets till Script now, really helpful, I have improved a lot. Thank you very much. I encountered a problem can't be solve, hopefully Sir could give me an advice. I have created 218 events in Google Sheets and desire to create all those events in Google Calendar, I can't create events in a bulk, how do I solve this problem?
@ExcelGoogleSheets3 жыл бұрын
Did you try the example in the video?
@wongkinwah10523 жыл бұрын
@@ExcelGoogleSheets I followed exactly as video, no problem at all until exceed 25 events. Anyways, I could solve my problem by using "utility.sleep" command. Thank you Sir.
@ugesazoom61697 жыл бұрын
Hola: Copié el còdigo. (Creo que bien). Lo pueden verificar viendo el video. Se los dejo aquí para que lo re utilicen luego de corregir los errores que pueda tener por mi que no me haya dado cuenta o por algún motivo. Yo lo probé y en la depuracion de la funcion getEvents me sale "las coordenadas o dimensiones del intervalo no son validas" : ss.getRange(2, 1,lr-1,5).clearContent(); En el video se ve el inicio del codigo en el minuto 12:19. Luego en la depuracion de la funcion addEvents me sale el error que dice "No se puede encontrar el metodo createEvents(string,string,string,object)" en esta linea de codigo : cal.createEvent(data[i][0], data[i][1], data[i][2], {location: data[i][3], description: data[i][4]}); que en el video se puede ver terminada en el minuto 16:51. Por lo demás no surgen errores en la depuracion. Aqui les pego el código entero con las diferencias de la fecha en la primer funcion (no se si puede afectar en algo y no se si cada vez que se quiera ejecutar hay que actualizarla o para que està pero bueno) siguiendo por el cambio de posicion de los datos de dia y mes que los anglosajones ponen primero el mes y luego el dia (supongo que esto no afecta en nada si se le da el mismo formato a la celda donde estarán las fechas y horas) y la otra diferencia es la id del calendario sobre el que quiero trabajar (cada cual pondrá la id que corresponda a su calendario así que es irrelevante). Bueno espero que les sirva y si les es posible ayudarme a entender que está mal en el código para depurarlo correctamente y funcione. Muchas gracias a todos. Codigo: function getEvents(){ var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var cal = CalendarApp.getCalendarById("id_del_calendario_que_va_a_usarse@group.calendar.google.com"); var events = cal.getEvents(new Date("27/12/2017 02:16 AM"), new Date("27/12/2017 02:30 PM")); var lr = ss.getLastRow(); ss.getRange(2, 1,lr-1,5).clearContent(); /**ERROR DE DEPURACION**/ for(var i = 0;i
@santosahernandezmendoza71476 жыл бұрын
Me funcionò!
@CesarPeron6 жыл бұрын
Funciona!, se ve que en la variable getRange("A2:10" + lr) iba la columna E y no el 10, me sonó raro y lo mas extraño que en el video le funciona, gracias por compartir
@IsaacTannerDempsey3 жыл бұрын
Can we download this from your website?
@enzymeone12406 жыл бұрын
Any video about delete events for ex by ID ?
@huynguyen70485 жыл бұрын
Curious face.I have the same question
@huynguyen70485 жыл бұрын
got it. You can run this code to remove old events before running addEvents function: var events = cal.getEvents(new Date ("02/8/2019 12:00 AM"), new Date("02/28/2019 11:59 PM")); for (var i=0;i
@asyrafsyahmi91626 жыл бұрын
Can I know how to create event in Google Calendar when it meet specified criteria in google sheet? Request leave for example. It create new events when only the request is approved.
@derekherzog15695 жыл бұрын
you could do that with a trigger I'd think, see how to do that here: stackoverflow.com/questions/26187361/triggering-script-by-specific-cell-value
@mohammedzaid38783 жыл бұрын
How to get the events from all domains?
@catherines49322 жыл бұрын
This Google Apps Scripts for Sheets playlist is brilliant! for the addEvents function, I've used .getSheetByName("Sheet2") for the function to work. Despite clicking and saving Sheet 2, .getActiveSheet() wasn't working for me. Are there any common reasons for this? What makes the class know what my active sheet is?
@ExcelGoogleSheets2 жыл бұрын
Active sheet should be whatever the last selected sheet was in the spreadsheet.
@itstigerplaysyt694206 жыл бұрын
Everytime I add some events then run the add events code, the previous events keeps on duplicating after every run. How do I fix it?
@huynguyen70485 жыл бұрын
Curious face.I have the same question
@huynguyen70485 жыл бұрын
Got it. You can run this code to remove the old events before running addEvents var events = cal.getEvents(new Date ("02/8/2019 12:00 AM"), new Date("02/28/2019 11:59 PM")); for (var i=0;i
@bperotta5 жыл бұрын
Try this (create a status column): ... for(var i = 0;i
@AnkitKumar-pk8tk5 жыл бұрын
@@bperotta is there any way that everytime I add a new row in spreadsheet it automatically create event in my calendar and I don't have to run it again and again Please help me
@bperotta5 жыл бұрын
@@AnkitKumar-pk8tk maybe you can add a Trigger, by clicking on "clock" icon in the javascript. Choose, for example, every 1h, 1 minute, or at one specific time eg. 3 AM. The problem with trigger by specific time is that the script could add an incomplete event. A conditional could resolve this (if all cells in a row has a content, then run script).
@christianebers5 жыл бұрын
Is there an easy way to split the date and time into two columns? If so can someone reply with the logic! ty
@sevaricofrathe57334 жыл бұрын
I had to do this. It's easier to redesign the original sheet to format it as time. I was given 0755-0830 for all the times. I used =SPLIT("-",A13,true,true) to get 0755 and 0830 in different cells. Then had to use 2 tables and if statements to convert the 0755 (number) into 07:55 (time). THEN assembled all the parts back together. Good luck.
@mariyamego96135 жыл бұрын
forEach does work. You just have to attach it to an array, i.e. data.forEach()
@ExcelGoogleSheets5 жыл бұрын
Did I say it doesn't work?
@mariyamego96135 жыл бұрын
@@ExcelGoogleSheets yeah, around 9:37
@ExcelGoogleSheets5 жыл бұрын
oops :) I stand corrected.
@fantouch6 жыл бұрын
One of my accounts is with a not gmail user, when I tried to open scripts from googlesheets it shows me an error. It is because I’m not using a @gmail.com??? The error page redirect me to google drive
@ExcelGoogleSheets6 жыл бұрын
gmail has nothing to do with it. You need to make sure that account has proper permissions to access the script.
@dextersocc6 жыл бұрын
Is it possible to modify the code to configure the color of each event?
@derekherzog15695 жыл бұрын
It is; you can view color properties here: developers.google.com/apps-script/reference/calendar/event-color
@pichit.raetai6 жыл бұрын
Thank you
@varunsethi56623 жыл бұрын
Sir why dont you share the codes too .. thanks
@fantouch6 жыл бұрын
I am having problems, LastRow is giving me a lot of blank rows . I do not know why. I bring the information with a query from another sheet. (When A is not Null). but the script when I run it gives me the information of all the blank cells. [,,,,,,,,] like this. why lr = ss.getLastRow(); is not working? function addEvents() { var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var lr = ss.getLastRow(); var data = ss.getRange("A2:G" + lr).getValues(); for( var i = 0; i 1000 (numer of rows in the file)
@ExcelGoogleSheets6 жыл бұрын
Try this function doStuff(){ var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var lr = getLastNonEmptyRow(ss,1); Logger.log(lr); } function getLastNonEmptyRow(sheet,column){ var lr = sheet.getLastRow(); var rngset = sheet.getRange(1, column, lr, column).getValues().map(function(d){ return d[0]; }); var pos; for(var i = rngset.length-1;i>=0;i--){if(rngset[i] !== ""){pos = i+1; break;}} return pos; }
@fantouch6 жыл бұрын
I use all of that above .... function addEvents() { ..... and remove " var lr = ss.getLastRow(); " from the function? or I use all of that inside " function addEvents() {" ??
@fantouch6 жыл бұрын
BTW thank you for go the extra mile
@fantouch6 жыл бұрын
It works, Good
@ExcelGoogleSheets6 жыл бұрын
OK, cool, I'm glad you figured it out.
@phoenixempire88864 жыл бұрын
🙏🏻
@rishirishi49702 жыл бұрын
Thanks
@kollosal7864 жыл бұрын
not sure if this was already tackled on later parts but Google servers sometimes gives an error for fast event creation. Error: “You have been creating or deleting too many calendars or calendar events in a short time.” Adding Utilities.sleep() for every event created helps. Here's a reference: stackoverflow.com/questions/29308656/error-you-have-been-creating-or-deleting-too-many-calendars-or-calendar-events
@ExcelGoogleSheets4 жыл бұрын
Great tip!
@marcobanderas33063 жыл бұрын
I'm getting the following error all the time: "Exception: Invalid argument: startTime", although I followed your tutorial twice ;/
@ПавелПитерский-д7г5 жыл бұрын
Thought (looking at the video's title) that you find out the way to make a bulk creation\updating calendar events... heh) sad it's not... but cool video never the less
@derekherzog15695 жыл бұрын
Hm I thought it pretty clearly explained how you could create bulk events. Paired with some sheets formulas the methods shown here could be very powerful. Mind you it did not go over updating, although I would think you could pair it with the deleteEvent() method to effectively do the same thing
@ПавелПитерский-д7г5 жыл бұрын
@@derekherzog1569 Yes, it's explained how one could create bulk of events from sheet, but my thoughts was (based on video title) that you find the way how to use calendar API to create events in batch/bulk )) Similar to Batch update operations in sheets API The matter is that if you have a really lot of events to create (as I do) - creating them "one by one" calling the API in "for" cycle takes a lot of time (since individual API calls are slow) and in my case I have to make it in few iterations or script will be failed due to execution's overtime
@derekherzog15695 жыл бұрын
@@ПавелПитерский-д7г Thanks for explaining, that makes sense. Based on your issue though I'm worried I"m soon going to be encountering the same issue. I'm also working on a project where I have to programmatically create/update bulk calendar events. I don't think I've ever had to go over 100 yet though and I haven't yet encountered the error you're getting (fingers crossed)
@GaneshMahadevSirsat2 жыл бұрын
gettting error Exception: The parameters (String,String,String) don't match the method signature for CalendarApp.Calendar.createEvent.