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

  • Home
  • SEARCH
  • 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 8942585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:33:01+00:00 2026-06-15T11:33:01+00:00

I created this script to be able to send an email after a grid

  • 0

I created this script to be able to send an email after a grid has been filled with information. Before the email is sent, another display comes in an warns the user to continue only if the information is correct. At the end the script sends an email to me, with the info entered by the user. The problem is here, when I received the email, the fields that the script is suppose to replace are shown as undefined and no info is there. Any ideas on what is wrong here??
Thank you!

function runmyapp() {
 var doc = SpreadsheetApp.getActiveSpreadsheet();
var app = UiApp.createApplication().setTitle('Title 1');
  var grid = app.createGrid(4, 5);
  grid.setWidget(0, 0, app.createLabel('Time '));
  grid.setWidget(0, 1, app.createTextBox().setName('Time'));
  grid.setWidget(1, 0, app.createLabel('Minutes'));
  grid.setWidget(1, 1, app.createTextBox().setName('Minutes'));
  grid.setWidget(2, 0, app.createLabel('Enter Name'));
  grid.setWidget(2, 1, app.createTextBox().setName('Name'));
  grid.setWidget(3, 0, app.createLabel('Email'));
  grid.setWidget(3, 1, app.createTextBox().setName('email'));
  var panel = app.createVerticalPanel();
  panel.add(grid);

  var button = app.createButton('Submit').setId("button");
  var handler2 = app.createServerHandler('dis');
  handler2.addCallbackElement(grid);
  button.addClickHandler(handler2); 
  var handler = app.createServerHandler('disc');
  handler.addCallbackElement(grid);
  button.addClickHandler(handler);   

  // Add the button to the panel and the panel to the application, then display the                              application app
    panel.add(button);
    app.add(panel);
  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  spreadsheet.show(app);
  }

function dis(e){
 var app = UiApp.getActiveApplication();
   app.getElementById("button").setText("Request is in process, please     wait!").setEnabled(false);
   return app;
   }; 

function disc(e){
   var app = UiApp.getActiveApplication();
   var html1 = app.add(app.createHTML("<p><p>Hello Expert,</p>"+
"<p>By clicking OK you agree that your information is correct</p>");
    var button = app.createButton('Ok').setId("button");
    app.add(button);
    var handler2 = app.createServerHandler('gsnot');
    button.addClickHandler(handler2); 
    var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  spreadsheet.show(app);
  return app;}




  function gsnot(e) {
    var advancedArgs = {bcc:e.parameter.email};
    var emailSubject = "Subject";
    var address ="albdominguez25@gmail.com";

    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!");

    var app = UiApp.getActiveApplication();
    app.close();
    // The following line is REQUIRED for the widget to actually close.
    var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  spreadsheet.show(app);
  }
  • 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-15T11:33:02+00:00Added an answer on June 15, 2026 at 11:33 am

    To make a widget value show on your e.parameter you need to add it (or a parent panel) as a callback element on the handler. Like this:

    function runmyapp() {
      //...
      var grid = app.createGrid(4, 5).setId('grid');
      //...
    }
    
    function disc(e){
      //...
      var grid = app.getElementById('grid');
      var handler2 = app.createServerHandler('gsnot').addCallbackElement(grid);
      //...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I bought this program that created a pretty nice imageuploader flash script however I
I have a script task that executes a dynamically created SQL restore statement. This
I have been dealing with this script for a long time already i can't
I've created this script below for a assignment I have. It asks for a
I used this script to create a jQuery accordion. Check out the working jsFiddle
This is my SQL Script CREATE TABLE account_profile ( accnt_id int NOT NULL ,
This is an HTML scrip that I created. I am trying to include a
This is the first Python script I've tried to create. I'm reading a xml
I have a script which creates a user-defined object like this: obj = new
I have a python script the runs this code: strpath = sudo svnadmin create

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.