google-apps-script

Blank response from UrlFetchApp in Google App Script

笑着哭i 提交于 2021-01-28 07:01:54
问题 I'm trying to test the endpoints of an API and all the responses return blank with no errors. I've tested using curl and the response actually has data in: curl --request GET https://myapiurl.com/endpoint --header "authorization: bearer TOKEN" Here's the segment of GAS code. The token property is set when I run a POST call to retrieve it, it expires after a while: var url = 'https://myapiurl.com/endpoint'; var token = 'bearer TOKEN'; var headers = { 'authorization': token }; var options = {

Is there a simple script one could you to scan QR code data and directly enter data the information into a specific column of the Google spreadsheet?

落花浮王杯 提交于 2021-01-28 06:40:32
问题 Lets see we have a simple spreadsheet that looks like this: TimeStamp, Name, Age, Email, QR code, Scanned Info Row1 Row2 Row3 Then column "QR code" is generated by using the trick from here https://docs.google.com/spreadsheets/d/1hBMoc-FmAXf4z3LOGez8hnXg_S6rbCnCDVNzfQOhlPc/template/preview?usp=drive_web and the QR code simply encodes the Name info per row which represents 3 different people in this case. Now, If one were to scan these 3 QR codes, how could I extract the information of the QR

Getting error: “Missing ) after argument list. (line 8, file ”Code“)”

点点圈 提交于 2021-01-28 06:30:05
问题 I am getting this error: "Missing ) after argument list. (line 8, file "Code")" When I run my code. I've tried to switch around the single quotes around ProfileNav-value to double quotes and that did not work either. When I paste the exact function in line 8 into a shoot sheet cell, it works but google scripts does not let me run it. function daily() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sh = ss.getSheetByName("BT"); sh.insertRowAfter(2); sh.getRange("A3").setFormula('=TODAY()

OnEdit function Does not recognize pasted (ctrl-p) Values as being a cell edit. Is it possible to get it to do so?

别说谁变了你拦得住时间么 提交于 2021-01-28 06:29:39
问题 I've got an script in my google sheet that stamps time codes into specific cells when a name is entered in the column next to it... However the script does not work when the names are copied and pasted into the column... is there a work around for this issue that will trigger the script on a cell having a value pasted into it? script: function onEdit(e) { var s = e.source.getActiveSheet().getName(); var cols = [3, 5, 7, 10, 12, 14, 17, 19, 21]; var curDate = Utilities.formatDate(new Date(),

Send email without server using google script: unable to open file error

▼魔方 西西 提交于 2021-01-28 06:29:22
问题 I want to send an email to a location target@example.com using google script . I am following this - https://github.com/dwyl/html-form-send-email-via-google-script-without-server to setup the whole functionality in my website. There is an html form in my website and I want to send email whenever someone clicks on the submit button on my site here is the html of the form - <div id="content"> <h1>Contact Us</h1> <h4>Fill out the form below and a representative will contact you shortly.</h4>

Script Manager Not Showing in Google Spreadsheet

荒凉一梦 提交于 2021-01-28 06:28:28
问题 I've created a number of email scripts for our company's internal usage. Usually I create the script, save and then when I open the spreadsheet I can go to the Tools > Script Manager and run the script. It is not showing up - only Script Editor and Script Gallery. The script is not a "stand alone" script - I created it from the spreadsheet's Script Editor. Is this something that has been disabled in the new Google spreadsheets? Or is there something else I need to code in the script to have

Why do we use SpreadsheetApp.flush();?

筅森魡賤 提交于 2021-01-28 06:23:01
问题 I'm a complete beginner. I read the Google Document for the solution. I searched out the internet for the same. I also searched out StackOverflow for the same. But. Everything seems technical. What I understand is, .Flush helps to execute the functions as and when they happen without bundling them in one. Am I right? If not, What's the meaning in layman terms? And please, with a simple example. Thanks. 回答1: A programmer will use flush() when they want to ensure that the previous code's output

Google sheets - clear all rows with a date cell having a date older than one week

蹲街弑〆低调 提交于 2021-01-28 06:20:33
问题 I'm trying to get a google sheet to hide or delete rows that have a date more than 1 week old in them. This is what I've managed to piece together. function ClearOld() { var ssActive = SpreadsheetApp.getActiveSpreadsheet(); SpreadsheetApp.setActiveSheet(getSheetByName('Done')) var MyRange = ssActive.getRange("C:C");//selects C column var WeekAgo = new Date(date.getTime()-7*(24*3600*1000)); for(i = 0; i < MyRange.length; i++) { if(MyRange[i].getTime()<WeekAgo){ getActiveSheet().deleteRow(i); }

Would it be possible to crop image using google app script without using any third party api

人盡茶涼 提交于 2021-01-28 06:06:11
问题 I want to crop an image with Google App Script if an image outside the page frame, but as far as I checked in Google App Script documentation and I could not find a way to crop the image. pageElements.asImage().replace (imgBlob, true); it is not allowed to pass cropping dimensions as parameters in .replace() to crop a image. i know this can be achieved using a custom API , passing the image blob and crop area that will call cropping method on another server. But how it will be possible to

Google Apps Script TeamDrive DriveApp.searchFolders and DriveApp.searchFiles does not return any results

瘦欲@ 提交于 2021-01-28 06:01:06
问题 I have some Google Apps script code that searchs for files and folders on TeamDrive. The issue I am having is that if a file or folder is created by my colleague, when I run my script it can't find the file. If I create a file, and my colleague runs the script, the script can't find the file even though we both have access to view, edit and can see the files and folders in Drive. If one of us edits the file made by the other person, then it becomes visible from the search. I ran into a