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 8423093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:38:14+00:00 2026-06-10T03:38:14+00:00

I am having some problem with my code for Google Script below: When I

  • 0

I am having some problem with my code for Google Script below:

When I do: var Emails = e.parameter.Email; (IN FUNCTION Aut_User)

I cant get the value, it appears undefined, value is not passing from one function to another.

What is wrong?

function doGet() {
  var app = UiApp.createApplication();
  var grid = app.createGrid(3, 2);
  grid.setWidget(0, 0, app.createLabel('Informações para Login:'));

  var Contactemail = app.createTextBox();
  Contactemail.setName('Email'); 
  grid.setWidget(1, 0, app.createLabel('Email:'));
  grid.setWidget(1, 1, Contactemail);

  var Contactpassword = app.createPasswordTextBox();
  Contactemail.setName('Password'); 
  grid.setWidget(2, 0, app.createLabel('Senha:'));
  grid.setWidget(2, 1, Contactpassword);


  var panel = app.createVerticalPanel();
  panel.add(grid);


  var button = app.createButton('Logar');
  var handler = app.createServerHandler('Aut_User'); 
  handler.addCallbackElement(grid);
  button.addClickHandler(handler);

  panel.add(button);
  app.add(panel);
  return app;
}

function getColIndexByNamelink(colName, ID) {
  var sheet = SpreadsheetApp.openById(ID).getSheets()[0];
  var numColumns = sheet.getLastColumn();
  var row = sheet.getRange(1, 1, 1, numColumns).getValues();
  for (i in row[0]) {
    var name = row[0][i];
    if (name == colName) {
      return parseInt(i) + 1;
    }
  }
  return -1;
}

function Aut_User(e) {
  var ID = "0AqmZV_vU4x5cdFQyOFo2TlE3dkxFYi1rVUk3OUxzYWc";
  var sheet = SpreadsheetApp.openById(ID).getSheets()[0];
  var lastRow = sheet.getLastRow();
  var Emails = e.parameter.Email;  //PROBLEM HERE
  //parametros da outra funcao
  for (var i = 2; i < (lastRow + 1); i++) {
    sheet.getRange("A4").setValue(Emails);
    //conferir os dados
  }
}
  • 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-10T03:38:15+00:00Added an answer on June 10, 2026 at 3:38 am

    You have a mistake in your code:

    var Contactpassword = app.createPasswordTextBox();
    Contactemail.setName('Password');
    

    The second line here should be:

    Contactpassword.setName('Password');
    

    I found this by using the following code in Aut_User(e):

    var app = UiApp.getActiveApplication();
    var output = '';
    for (var i in e.parameter) {
       output += i + ' = ' + e.parameter[i] + '; ';
    }
    

    Then sending ‘output’ to a place I could read it. I saw the value for ‘Password’ was the email address entered.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code is having some problem with the jQuery. <script type="text/javascript"> $(window).load(function() {
I'm having some problems trying to get the code below to output the data
I am having some problem with jsonp and jquery. This is my code -
I'm building a website and having some problem. if the HTML code is like:
I'm having a problem with some code I've written. I've had to anonymize it,
I'm having a problem with some code that used to work in PHP 4.X
I've having this problem with some JavaScript code. I've simplified it in the error
Here is some sample code to illustrate the problem I am having. #include <iostream>
I am having a problem with a simple callback function in jQuery ajax. Google
I'm having some strange issues with a textarea in Google Chrome. The problem is,

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.