Questions tagged [google-apps-script]
Use for questions about Google Apps Script, Google's JavaScript-based cloud scripting platform for automating tasks across Google products and third-party services. Use in addition to relevant product-specific (e.g. [google-sheets], [google-docs]) or API-specific (e.g. [google-drive-api]) tags where applicable
39,180
questions
0
votes
0answers
13 views
Emailing a Range in Google Scripts Within A Properties Service Script?
I currently have the following code within Google Scripts, with a trigger enabled which once the trigger is activated, will email users once a figure has changed against the previously stored number. ...
0
votes
0answers
13 views
Need assistance with converting an apps script onEdit function into a regular function that can be invoked using a button
I have wrote an apps script which is an onEdit function. it helps me to create PPC campaigns by checking a checkbox next to a record in Campaign Input tab (col K). It works well. But, I have to ...
0
votes
0answers
10 views
Delete specified Row & Move all Below Rows Up Once? - Google App Script
I am using a script that currently:
Reads the data from a row (A2-H2 for example.) on a google sheet.
Writes that data to a google doc and saves it as a new file.
My question is, can you recommend a ...
0
votes
0answers
7 views
How do I deploy my apps script into my google sheets
I have written a google apps script which sorts 2 columns in a sheet and I want it to always be running when the sheet is updated by a jotform submission. The script works fine when i test it but I've ...
0
votes
0answers
12 views
Protect row according to the data in cell (Yes/No)
I have a sheet with a table. When me or one of my editors changes the data of the cell in column F (so that it is not blank), I need the row to become protected for everybody except me (owner).
I ...
0
votes
1answer
12 views
Google Apps Script: my function of copy,paste and delete doesn't yet execute all the rows
Please help me the experts!
What I would like to do?
Copy the whole rows that contains value of 'Paid'
Paste the rows to the last row of another sheet.
Delete the rows
However, after I use codes as ...
0
votes
1answer
9 views
Exception: Unexpected error while getting the method or property setNumberFormats on object SpreadsheetApp.Range - Existing answer doesn't help me
I found the exact same question on here but I don't think the answer helps me.
I haven't ran this code for some weeks, it wasn't generating this error previously but now it is. I haven't changed ...
2
votes
1answer
19 views
My GAS script can't create events without any errors
Problem
I want to make a script that creates events from specific emails, and I made it. When I run it, it was completed without exceptions. But no events appeared on my actual calendar.
I think my ...
1
vote
1answer
15 views
Event variable in Google sheets doesn't fetch a value of the cell to which I do copy and paste a value from another cell
My event variable gets a value of an edited cell just fine when I edit a cell manually, but completely ignores when I do paste or paste special.
For example, when I write foo in A1 cell manually, the ...
0
votes
1answer
12 views
403 response on API call from GoogleScript
I used this piece of code from https://developers.rebrandly.com/docs/api-custom-url-shortener. I filled my key. Also typed work space "Main Workspace" (not sure if that is correct [or ...
0
votes
0answers
8 views
How to consolidate data from different google sheets not tabs of the same googlesheets?
How to consolidate data from different google sheets (not tabs of the same googlesheets but different google sheets) into one single sheet using appsscript??
I have data in different Google Sheets and ...
0
votes
1answer
23 views
Embedding Google Apps Script in an iFrame Error
I've looked at other stack posts on this topic and with their help I think i may have successfully loaded my google app into an iframe but im not sure. I'm getting a "Google Apps Script" ...
-1
votes
0answers
8 views
How to Automatically Link a Google Form Submission
I am using Google Forms to take orders with my small business and I am looking to create a Google Apps Script function that onFormSubmit will AUTOMATICALLY link the form submitter to a custom website.
...
-2
votes
0answers
16 views
LDAP Search from Google Apps Script (ideally within Sheets)?
I see that there's a somewhat-similar question to this here, but it's 8 years old, so I thought I might ask again:
Is there any way to do an LDAP search from within a Google Apps Script (like ...
-2
votes
0answers
32 views
Google Sheets Script Copying a Value
Hello I want to copy a value from on cell into another one. This is no Problem right now, but when i clear the cell an enter another value it should paste it to the next row under it. In order to ...
-2
votes
1answer
23 views
Is there a way to copy a specific sheet from one workbook to a specific (and different) folder as its own stand alone sheet in google?
This is what I have so far:
function saveAsSpreadsheet() {
var source = SpreadsheetApp.getActiveSpreadsheet();
var sheet = source.getSheets()[6];
var destFolder = DriveApp.getFolderById("...
0
votes
0answers
19 views
Google Apps Script (latest Google Drive XLSX file to Google sheet) [closed]
So I've found a few related threads and they all get me about 80% there, hoping someone can help me connect the dots here. I have no javascript background so this is a bit foreign to me but I get the ...
0
votes
1answer
44 views
Automatically reverse an edit to a google sheet cell
I have seen before a google script that, in onEdit(e), automatically reversed whatever edit was made to a given sheet cell. I'd like some code for that!
Thanks for whatever help you can provide.
0
votes
1answer
31 views
Is there any way to manage a note set in a cell in GAS?
I want to make a gimmick to judge whether a cell has a note or not in Google Apps Script with Google Spread Sheet.
We can set note in a cell using setNote method. However, I don't know how to use the ...
0
votes
1answer
45 views
Show the first non blank cell of a table
I am importing data with ImportJSON from Yahoo Finance of different stocks. It is the first table at the top, that's showing some data about different parameters.
The problem is that due to some paths ...
0
votes
0answers
18 views
class ui.showModalDialog throws LocalStorage Security exception when āBlock Third-Party cookiesā is enabled in chrome browser
Currently in our application (Both Google editor add-on and Google Workspace add-on), we are using showModalDialog to load a different URL in an iFrame.
Link)
Here is the code snippet for the same:
...
-1
votes
1answer
16 views
I cannot find permit button for access permission when running GAS
When I pressed Run button on the Google Apps Script page, I got the message below:
Authorization required
This project requires your permission to access your data.
I clicked Review permissions and ...
0
votes
0answers
22 views
google apps script : Http request with proxy
I try to execute an HTTP request that use a proxy on App scipts :
On VB I wrote that script :
Dim encoded,responseFromServer As String
Dim request As HttpWebRequest
Dim myProxy As WebProxy
Dim ...
0
votes
1answer
38 views
Combine two onEdit functions, each of them working for its own sheets using its own data
I have two codes. Each of them gives me three drop-down lists depending on each other and works for different sheets. Each code uses its separate list of data.
How can I combine these two scripts, ...
0
votes
1answer
66 views
How do I find the Max and Min values of a row that my if statement has been applied to?
So I was given this yesterday and this works brilliantly but I have been asked to bold the minimum and maximum value on the row that my function below has been applied. I have 3 different datasets ...
0
votes
0answers
19 views
When press button to go to other pages and it shows sorry unable to open file at this time google appscript
I've tried to build multi web by using google appscript for other people to check or edit their information in database(google spreadsheet), reserve time to photo which also link to google spreadsheet....
0
votes
1answer
21 views
sending an embed from google scripts to discord using Webhook
im now working on sending a notification when triggered that sends an embedded message to discord from google scripts.
I've gone through multiple resources however cannot find one that works.
I can ...
0
votes
1answer
16 views
Send data from one google sheet to a another google sheet with app script
I wonder if any of you kind members would be able to help me rewrite the below code, which currently sends the data from the tab called "Sheet1" ( which is my submission form) to the tab &...
0
votes
0answers
29 views
Save data to range
i'm trying to make a script that saves the form data only in the range ("A10: B17) .. can someone help me, please?
function addNovaLinha(dadosLinha) {
var sheet = SpreadsheetApp....
0
votes
1answer
28 views
Calendar API to modify the following events only using Google Apps Script
I have events those repeat for every Monday starting from Feb 8, 2021. I want to modify the upcoming 28th Feb 2021 so that all future events will be repated every Wednesday. Note that the event must ...
0
votes
0answers
24 views
google.script.run pass variable and get return in promise
Im puzzling how to get the return from a google.script.run while also passing variables to the run function.
My google script function is:
function message(text) {
var cursor = DocumentApp....
0
votes
1answer
35 views
How to write where clause in Google sheets to evaluate the values of different sheets?
Let me say there are two sheets named foo and master.
When I set in B2 cell of foo the following query
=query('master'!A1:A6, "select A where A='"&H1&"'")
the B2 cell of ...
0
votes
0answers
32 views
Is there any method to shows sent email in the Sent Mailbox using MailApp Google Sheet Apps Script?
I use MailApp by Google Apps Script in Google Sheets to send bulk emails and I found that after successfully send out the message, it doesn't shows in the Sent of my mailbox
Can I know is there any ...
0
votes
2answers
34 views
Printing Unspecified Number of Array Contents in Google Sheets Cells (GAS)
I am collecting information from a database, based on a filter and is stored in an array of arrays. Once this information is collected I want to be able to print this data onto a new sheet like this:
...
1
vote
2answers
46 views
XmlService using Apps Script is finding an error with the '&' symbol
I have the below function trying to convert a webpage to xml, so I can start extracting out some data from tables etc.
function getWebpageContent() {
var url = "https://training.gov.au/...
0
votes
1answer
36 views
How to exceed the 30mins time on Apps Script
I am pulling file list on spreadsheet and some folders will take 1 hour to get all the data. How can I exceed my time limit to get all the data? Currently limit is 30mins.
Here is my code:
function ...
0
votes
2answers
44 views
Why new Date() returns GMT-0500 (Eastern Standard Time)? [duplicate]
How can I get UTC current date object? I have no idea why it is Earstern Standard Time. I have never used this time zone in any Google Products.
Input:
function myFunction() {
const today = new ...
0
votes
0answers
19 views
Rename google form uploaded image by form value
I know google form can use the script to modify the files, but I don't know how to type the script. I have a Google Form for collect the information and image. Since each student can uploaded max. 5 ...
0
votes
1answer
40 views
Trouble returning API response leveraging fetch
Been working on a script to execute in Google Apps Scripts to pull some data from an external API and post that information into a Google Sheet. I have a script that works client side (running from ...
1
vote
1answer
39 views
Why is this comparison not working, using google aps scripts?
The code below is not giving me the expected result.
It's to compare rows from two ranges and, although the second range's last row equals the one from the first range, it gives me false as the result....
0
votes
1answer
38 views
Google App Script accessing third level JSON object
When I tried calling hello() on my Google Sheets, it return
Error TypeError: Cannot read property '5. Exchange Rate' of undefined (line 50).
Trigger for the Apps Script is also set up
Criteria
set
...
0
votes
1answer
33 views
Adding Variables to getRange()
Having a hard time with the below Google Scripts JS code.
Here's what it's supposed to do.
Copy and paste info from active sheet from column M to column AA
Go to sheet 2, get the last cell with data ...
0
votes
0answers
23 views
JSON.stringify.replace for updating Mail Merge code that uses Gmail draft as template
I am working on a mail merge that picks the template from Gmail draft and then replaces all the {{columnName}} with respective column values from google sheet. Each mail is identified by a unique ID, ...
0
votes
1answer
46 views
Using IF statements to create an error message if my function doesn't apply to my data in my sheet
I am just trying to create a message to say "Error. Value Invalid" for when I click yes but the function searchOutput() doesn't apply to the data that I have given it. I know my first IF ...
-1
votes
2answers
20 views
TypeError: Cannot read property 'values' of undefined (line 2, file “Auto Fill Google Doc”)
I am attempting to use an app script to link my Google Forms to a Google Doc template. I followed a video on YouTube step by step but for some reason, I am getting stuck on this error title
TypeError:...
-1
votes
0answers
15 views
I need a google form response to create a new tab on the 1st of every month and responses go to new tab
//Here is my current code I need the form to create a new tab in the current sheet it is already linked to and start posting the new responses to the new tab. I would like this to happen on the first ...
0
votes
1answer
43 views
AppScript to strikethrough partial text on match
I'm looking to get some help with Google Docs and Scripts. I have a workflow list that shows names of employees assigned to a task. There is also another field that indicates employees off of the day. ...
1
vote
1answer
33 views
Google Script experienced an error only for other users (works fine for me)
I'm new to this and created a simple script to collect data with a save button.
It works fine for me as the developer, but other users get an error message:
"Script [name_of_script] experienced ...
0
votes
1answer
26 views
How to setValue() when it's an entire row in google apps script?
I've been trying to run this one and althought currentRow has about 23 columns, I only have the first column's value set:
targetSheet.setActiveRange(targetSheet.getRange(maxIndex + 2, 1))
.setValue(...
0
votes
0answers
18 views
Form uploading file in Google Script from my html
i just want to upload file from my external html(localhost) then upload to Google Drive, or how can i get the link of last uploaded file to my php or html. Sorry for my bad english i hope you ...