Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8848463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:25:43+00:00 2026-06-14T12:25:43+00:00

I have a script that captures information from a panel. Once the info has

  • 0

I have a script that captures information from a panel. Once the info has been entered, user clicks a Submit button and the data entered is stored in a spreadsheet that will later be used to replace some fields of a template that I have on a cell on that spreadsheet. This process is very time consuming, like around a minute to perform all this. What I was wondering is if is possible that instead of storing the data in a cell on the spreadsheet if I can use the parameters info, and replace it on the template I have. Any ideas on how to do this?

function a(e) {

   var doc = SpreadsheetApp.getActiveSpreadsheet();
var timecell = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Templates").getRange("A2");
var timebval = timecell.setValue(e.parameter.Times);
var t1 = timecell.getValue();
var mincell = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Templates").getRange("A3");
var minbval = mincell.setValue(e.parameter.Minutes);
var t2 = mincell.getValue();
var namecell = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Templates").getRange("A4");
var nabval = namecell.setValue(e.parameter.Name);
var t3 = namecell.getValue();
var email = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Templates").getRange("A5");
var emaval = email.setValue(e.parameter.email);
var t4 = email.getValue();
var address = "albdominguez25@gmail.com";
var advancedArgs = {bcc:t4};
var emailSubject = "Test";

var emailTemplate =SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Templates").getRange("A1").getValue() ; 
  emailTemplate = emailTemplate.replace("TIME",t1).replace("MIN",t2).replace("EXP",t3);   



MailApp.sendEmail(address, emailSubject, emailTemplate, advancedArgs);

Browser.msgBox("Your Email has been sent!");
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:25:45+00:00Added an answer on June 14, 2026 at 12:25 pm

    Instead of storing something to a spreadsheet and reading back from it for each value, just directly use the value in the replace method as shown below.

    function a(e) {
      var address = e.parameter.email;
      var advancedArgs = {bcc:t4};
      var emailSubject = "Test";
    
      var emailTemplate = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Templates").getRange("A1").getValue() ; 
      emailTemplate = emailTemplate.replace("TIME", e.parameter.Times).replace("MIN", e.parameter.Minutes).replace("EXP", e.parameter.Name);   
    
      MailApp.sendEmail(address, emailSubject, emailTemplate, advancedArgs);
      Browser.msgBox("Your Email has been sent!");
    }
    

    If you must store these values in your spreadsheet also for later reference, it is faster to do one setValues instead of calling setValue several times. After you use the parameter info to send the email, just call this to set all the values at once:

    var range = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Templates").getRange("A2:A5");
    range.setValues([[e.parameter.Times], [e.parameter.Minutes], [e.parameter.Name], [e.parameter.email]]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a GM script that captures a keystroke and programmatically clicks an
I have an isolated python script that simply captures data from Twitter's streaming API
I have a script that obtains information about the current folders and subfolders within
I have a script that reads a list of addresses from a table and
I have a plain perl script that can be run from the command-line via
I have a Perl script that reads regex search and replace values from an
I have an R script that pulls data from a MySQL database, processes it,
I have a long-running Python script that I run from the command-line. The script
I have a web app that captures date / time via a JS script
I have script that reads remote file content and writes it to local server.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.