Connect with us


javascript-The Google Apps Script function runs when run manually, but fails when run as a trigger and displays the error code INTERNAL




It’s closed. This question needs more focus. We are currently not accepting answers.

Want to improve this question? Please update your question so that you can focus on one issue just by editing this post.

It closed 4 hours ago.

I have a Google form linked to a Google spreadsheet. Within Google Sheets, there is a Google Apps Script function that separates the input from the Google form and saves each item line by line. I have a VLookup setup to get information from another spreadsheet based on parsing from Google Apps Script. Once the information is obtained, we will email the information to the email provided by the Google form. There is a trigger setting that automatically executes the function when the form is submitted. The photo below is the form result of the sheet.

Form submission information

Triggers work when you select some options in the Google form. If you select more than 20 options, the following error code is returned.

Sorry, the JavaScript engine reported an unexpected error. Error code INTERNAL.

However, if you run the function manually, it will run completely. I’m not sure what the problem is. The only other question I’ve found about this issue is that the web app call fails with “… error code INTERNAL” in the custom API, but I’m already using openByID. The e in the function onFormSubmit below is my attempt to use a form object, but it doesn’t work. But I don’t think this causes any problems.

// Object that stores city and state in one object functioncity (city, state) { = city; this.state = state;} function onFormSubmit (e) {// Set the active sheet and fill in the form information Store in variable // This function is executed based on the formSubmit trigger var sheet = SpreadsheetApp.openById (‘sampleID’); SpreadsheetApp.setActiveSheet (sheet.getSheets ()[0]); var lastRow = String (sheet.getLastRow ()); var email = String (sheet.getRange (‘D’ + lastRow) .getValue ()); var name = String (sheet.getRange (‘B’ + lastRow)) .getValue ()); var company = String (sheet.getRange (‘C’ + lastRow) .getValue ()); var state = String (sheet.getRange (‘E’ + lastRow) .getValue ()). split (“,”); var list_cities = []; // Separate City, State into objects with City & State properties n = 0 for (x of String (sheet.getRange (‘F’ + lastRow) .getValue ()) .split (“,”)) {if (N = = 0) {var city_name = x.trim (); n = 1;} else {n = 0; var temp = new city (city_name, x.trim ()); list_cities.push (temp);} } // Move to the next sheet SpreadsheetApp.setActiveSheet (sheet.getSheets ())[1]); //[フォーム]Clear tab lastRow = String (SpreadsheetApp.getActive (). GetLastRow ()); SpreadsheetApp.getActiveSheet (). getRangeList ([‘A2:B2’, ‘A3:F’ + lastRow]). Sunny (); // Initialize the first line varrow = 2; // (x of state) {SpreadsheetApp.getActiveSheet (). Enter in the State column of getRange (row, 1) .setValue (x.trim ()) ;. Line = line +1;} // (x of list_cities) {SpreadsheetApp.getActiveSheet (). Enter in the City column of getRange (row, 1) .setValue (x.state) ;. SpreadsheetApp.getActiveSheet (). getRange (row, 2) .setValue (; row = row + 1} // List of cell column headers varletters = [“C”, “D”, “E”, “F”]; // Copy the formula for each column of (x characters) {var sourceRange = SpreadsheetApp.getActiveSheet (). getRange (x + String (2)); var destination = SpreadsheetApp.getActiveSheet (). getRange (x + String (2) + “:” + x + String (row-1)); sourceRange.autoFill (destination, SpreadsheetApp.AutoFillSeries.DEFAULT_SERIES);} SpreadsheetApp.flush (); // Only the completed sheet Extract varurl = “”; var params = {method: “get”, headers: {“Authorization”: “Bearer” + ScriptApp.getOAuthToken ()}, muteHttpExceptions: true} var blob = UrlFetchApp.fetch (url, params) .getBlob (); blob.setName (SpreadsheetApp.getActive () .getName () + “.xlsx”); // Set email information and send email varmessage = {to: email, name:’Name’, subject: company + “Subject”, body: “Body text”, attachments: blob} MailApp.sendEmail (message)}

What Are The Main Benefits Of Comparing Car Insurance Quotes Online

LOS ANGELES, CA / ACCESSWIRE / June 24, 2020, / Compare-autoinsurance.Org has launched a new blog post that presents the main benefits of comparing multiple car insurance quotes. For more info and free online quotes, please visit https://compare-autoinsurance.Org/the-advantages-of-comparing-prices-with-car-insurance-quotes-online/ The modern society has numerous technological advantages. One important advantage is the speed at which information is sent and received. With the help of the internet, the shopping habits of many persons have drastically changed. The car insurance industry hasn't remained untouched by these changes. On the internet, drivers can compare insurance prices and find out which sellers have the best offers. View photos The advantages of comparing online car insurance quotes are the following: Online quotes can be obtained from anywhere and at any time. Unlike physical insurance agencies, websites don't have a specific schedule and they are available at any time. Drivers that have busy working schedules, can compare quotes from anywhere and at any time, even at midnight. Multiple choices. Almost all insurance providers, no matter if they are well-known brands or just local insurers, have an online presence. Online quotes will allow policyholders the chance to discover multiple insurance companies and check their prices. Drivers are no longer required to get quotes from just a few known insurance companies. Also, local and regional insurers can provide lower insurance rates for the same services. Accurate insurance estimates. Online quotes can only be accurate if the customers provide accurate and real info about their car models and driving history. Lying about past driving incidents can make the price estimates to be lower, but when dealing with an insurance company lying to them is useless. Usually, insurance companies will do research about a potential customer before granting him coverage. Online quotes can be sorted easily. Although drivers are recommended to not choose a policy just based on its price, drivers can easily sort quotes by insurance price. Using brokerage websites will allow drivers to get quotes from multiple insurers, thus making the comparison faster and easier. For additional info, money-saving tips, and free car insurance quotes, visit https://compare-autoinsurance.Org/ Compare-autoinsurance.Org is an online provider of life, home, health, and auto insurance quotes. This website is unique because it does not simply stick to one kind of insurance provider, but brings the clients the best deals from many different online insurance carriers. In this way, clients have access to offers from multiple carriers all in one place: this website. On this site, customers have access to quotes for insurance plans from various agencies, such as local or nationwide agencies, brand names insurance companies, etc. "Online quotes can easily help drivers obtain better car insurance deals. All they have to do is to complete an online form with accurate and real info, then compare prices", said Russell Rabichev, Marketing Director of Internet Marketing Company. CONTACT: Company Name: Internet Marketing CompanyPerson for contact Name: Gurgu CPhone Number: (818) 359-3898Email: [email protected]: https://compare-autoinsurance.Org/ SOURCE: Compare-autoinsurance.Org View source version on accesswire.Com:https://www.Accesswire.Com/595055/What-Are-The-Main-Benefits-Of-Comparing-Car-Insurance-Quotes-Online View photos

picture credit


to request, modification Contact us at Here or [email protected]