google-apps-script

Google Calendar API batch insert events with Apps Script

蹲街弑〆低调 提交于 2021-02-05 07:52:05
问题 Using Google Apps Script's UrlFetchApp, how can I use the Google Calendar v3 API to insert events in batches? Google lists this example batch request, but I don't understand how exactly to convert it. POST /batch/farm/v1 HTTP/1.1 Authorization: Bearer your_auth_token Host: www.googleapis.com Content-Type: multipart/mixed; boundary=batch_foobarbaz Content-Length: total_content_length --batch_foobarbaz Content-Type: application/http Content-ID: <item1:12930812@barnyard.example.com> GET /farm/v1

Event object of onSubmit is empty in Google script

匆匆过客 提交于 2021-02-05 07:43:19
问题 I have a Google form linked to a Google sheet. In that spreadsheet I have code that have this function onSubmit(e){ Logger.log(e) Logger.log("Call onSubmit") } The trigger is setup as follow Project: Spreadsheet's scritp Deployment:Head Event:From spreadsheet - On form submit Function:onSubmit So whenever I submit the form, the log shows [object Object] Call onSubmit The form has many questions, not an empty form. As I read the documentation, it seems like the event object has many

No logs are created in Stackdriver logging

最后都变了- 提交于 2021-02-05 07:17:06
问题 In my google app script, I have: Logger.log("test"); and I even tried console.log("test"); But neither is printed to the stackdriver log, even after I've set the project id to a Google Cloud Project id. The screen shows: 回答1: To being able to see the logs on Stackdriver your project should have linked to a Google Cloud Standard project instad of the default project otherwise you only could see the "Stackdriver logs" on the executions pages in https://script.google.com From https://developers

Unauthorized 401 error while 'execute as me'

Deadly 提交于 2021-02-05 07:01:48
问题 I am struggling with a web app I have deployed. When the site permission is available to 'all with the link', as the app is set to 'execute as me', a spreadsheet is properly removed from my drive and a new file created. If I restrict access to certain email addresses, the code no longer works. I tried passing a token using var auth = ScriptApp.getOAuthToken(); var header = { "authorization": "Bearer " + auth }; var params = { 'method':'post', 'headers':header, 'muteHttpExceptions':true}; var

OnEdit Not Triggering With Copy & Paste in Google App Script

China☆狼群 提交于 2021-02-05 06:15:47
问题 I have a script that adds the current date when column one is edited, but at the moment it doesn't work when a value is pasted in . Is it possible to make this script add the date for each row of the range that is pasted into column 1? function onEdit(e) { if (e.range.getSheet().getSheetName() == 'Add Statements Here' && e.range.getColumn() == 1) { e.range.offset(0,10).setValue(e.value.length>0 ? new Date() : ''); } } 回答1: When pasting onto the cell, the "value" property of the event object

I have enabled V8 runtime, but I get an error trying save: “We're Sorry, a server error occurred. Please wait a bit and try again.”

做~自己de王妃 提交于 2021-02-05 06:04:30
问题 I'm getting the "We're Sorry, a server error occurred. Please wait a bit and try again." when trying to save the script If I run the script as is, it runs an older version Here's my code: function myFunction() { var ss2 = SpreadsheetApp.getActiveSpreadsheet(); var sheet2 = ss2.getSheets()[0]; var cell = sheet2.getRange("D3:D6"); cell.setValue("Out"); var cell = sheet2.getRange("D8:D12"); cell.setValue("Out"); var cell = sheet2.getRange("D14:D17"); cell.setValue("Out"); var cell = sheet2

Insertion of brackets and quotation marks using Google Apps Script

 ̄綄美尐妖づ 提交于 2021-02-05 05:56:49
问题 I have recently started writing some scripts for Google Spreadsheets. I have no experience with Javascript though and I have question that is concerning a (as I suppose) basic issue. I would like my script to insert data shown below into a cell in a sheet. How should I encode it to make it work? komorkaLinku.setValue("=HYPERLINK("http://www.some.link/some/data"+variable+"something","something")"); I had tried several ways but none of them worked. 回答1: You are trying to include quotes inside

Insert data into a google spreadsheet via a link

∥☆過路亽.° 提交于 2021-02-04 21:53:10
问题 I'm looking for a way for users to send data from an email sent to them in a single click using google scripts. Basically, I have a spreadsheet with a list of emails, and I want to send an email to all of them (I've already set up a sort of mail merge script). The tricky part is that I want the emails to contain links unique to each person. If they click one of the links, I want data to be entered into the spreadsheet in the row corresponding to their email address. Is this at all possible?

Insert data into a google spreadsheet via a link

試著忘記壹切 提交于 2021-02-04 21:49:27
问题 I'm looking for a way for users to send data from an email sent to them in a single click using google scripts. Basically, I have a spreadsheet with a list of emails, and I want to send an email to all of them (I've already set up a sort of mail merge script). The tricky part is that I want the emails to contain links unique to each person. If they click one of the links, I want data to be entered into the spreadsheet in the row corresponding to their email address. Is this at all possible?

API Post request in Google App Script not working

杀马特。学长 韩版系。学妹 提交于 2021-02-04 21:27:46
问题 I managed to do the API POST request through Postman but once modified for Google App Script it doesn't work. I think it might be related to the body format, I can't replicate the new URLSearchParams() object in GAS (I'm sending a JSON I believe). Thanks. Postman (working) - JavaScript Fetch var myHeaders = new Headers(); myHeaders.append("Content-Type", "application/x-www-form-urlencoded"); var urlencoded = new URLSearchParams(); urlencoded.append("client_id", "XXXX"); urlencoded.append(