javascript - How to get the calender info of the candidate inside an orgainzation with google business app using google app script -


I am using the Googl HT web app script, from where I have to input the index and that information should be in Form Create a gif file as an object where it uses the start time and end time of candidates and some user ids in ABC dot com organization.

Now I have to clear the calendar time to use all the e-mail id.

  var user1_Cal = CalendarApp.getCalendarById ('user1@abc.com '); Var user2_Cal = CalendarApp.getCalendarById ('user2@abc.com ');  

& Lt; Div & gt; & Lt; Form id = "myform" & gt; & Lt; Input type = "user1" name = "user1" id = "user1" placeholder = "Enter your ID" & gt; & Lt; Br> & Lt; Input type = "user2" name = "user2" id = "user2" placeholder = "Enter your ID" & gt; & Lt; Br> & Lt; Input type = "start" name = "start" id = "start" placeholder = "start" & gt; & Lt; Br> & Lt; Input type = "end" name = "end" id = "end" placeholder = "end" & gt; & Lt; Br> & Lt; Input type = "submit" value = "myform_val" & gt; & Lt; / Form & gt; & Lt; / Div & gt; & Lt;?! = HtmlService.createHtmlOutputFromFile ('CSS'). GetContent (); ? & Gt; & Lt; Script src = "// ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> & Lt; / Script & gt; & Lt; Script & gt; $ (Document) .ready (function () {$ ( "# myform"). Submit (function () {google.script.run.withSccessHandler (function (ret) {console.log (ret);}). AddEmail ( This is the form element;}};); & lt; / scripts;

code.gs

  function doGet () {try {var html = HtmlService.createTemplateFromFile ( 'index'). evaluate (). SetTitle ( 'web app'). set Sandboksmod (Actimelsirivandboksmod. native);} catch (error ) {var errorSheet = SpreadsheetApp.openById ( 'errorsheet_id_here'). GetSheetByName ( 'errors'); Var cell = errorSheet.getRange ( 'A1') Offset (errorSheet.getLastRow (), 0); Cell.setValue (new date) + "DoGet function:" + error); } Return HTML; } Function addEmail (form) {try {// here we can use form.user1, form.user2, form.start, form.end var user1_Cal = CalendarApp.getCalendarById (form.user1); Var user2_Cal = CalendarApp.getCalendarById (form.user2); /// these two candidates should be given to the use of information and start and put us between the end time in the spare time and Autput_are and back can be returned to index.html Logger.log (user1_cal.getName ()) ; Var Today = New Date (); Logger.log (user1_cal.getEventsForDay (today)); Var Event = User 1_cal.getEventsForDay (today); Logger.log ('number of events:' + events.length); // I'm getting the number of events but want actual start and end time. Var myval = JSON.stringify (output_array); Return mawal; } Hold (error) {var errorSheet = SpreadsheetApp.openById ('sheet_id'). GetSheetByName ('Errors'); Var cell = errorSheet.getRange ('A1') offset (errorSheet.getLastRow (), 0); Cell.setValue (new date (+ + "and error is:" + error); }}  

Question: How to get free busy details to the user Note: The Google Calendar Business app has the setting

After doing some searching and working Comes with a Temple Sol, it will give the candidate's calendar event that you have added to your calendar. Therefore, it is basically how to add the User ID to the calendar which is running the script

  var event = user 1_cal.getEvents (new date ("26 October 2014"), new date ("October 28, 2014"); (Var i = 0; i & lt; events.length; i ++) {var description = [[Events [i] .getTitle (), events [i] .getDescription (), events [i] .getStartTime () , Events [i] .getEndTime ()]]; Var line = I + 1; Var range = sheet.gaterenz (line, 1,1,4); Range.setValues ​​(description); } Logger.log ('number of events:' + events.length);  

Enter image details here


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -