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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:17:09+00:00 2026-06-13T11:17:09+00:00

Can any help with the following issue??? Pretty new to app script / javascript

  • 0

Can any help with the following issue??? Pretty new to app script / javascript and would appreciate any help or guidance to figure out..

TypeError: Cannot find function offset in object Timestamp, (then continues listing the column headings in the red warning banner.

function uiSendLogEmail() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var data = sheet.getDataRange().getValues();
  data = data.offset(1,0,data.getNumRows())-1;


// For Loop

for ( var i = 0; i < data.length; i++ ) {
var row = data[i];
var approved = row[5];
var sentEmail = row[6];
var snapshot = row[3];

//if stmt in For Loop
if ( approved != "Yes" ) {              
  data[i][5] = "Yes";
  data.getDataRange().setValues(data);
      }// if stmt end curly 
else if ( approved == "Yes" && sentEmail != "Yes" ) {
  data[i][6] = "Yes";
  data.getDataRange().setValues(data);
  GmailApp.sendEmail("email@email.com", "subject", "body" + "whatever " + snapshot);
}//else if end curly
else {
return;
}//else stmt end curly

}// for loop end curly


 }
  • 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-13T11:17:09+00:00Added an answer on June 13, 2026 at 11:17 am

    I made a few basic tweaks that will hopefully point you in the right direction (and thanks to @AdamL for the .shift() method – much better than what I had in there before 🙂 ):

    function uiSendLogEmail() {
      var ss = SpreadsheetApp.getActiveSpreadsheet();
      var sheet = ss.getActiveSheet();
      var data = sheet.getDataRange().getValues();
    
      // Move the values down
      data.shift();
    
      // For Loop
      for ( var i = 0; i < data.length; i++ ) {
        var row = data[i];
        var approved = row[5];
        var sentEmail = row[6];
        var snapshot = row[3];
    
        // Here we set a range equal to the data range offset by 1 + our current
        // position in the loop (cycling through rows), and then get the A1 notation
        // of the first row, which we use to get that particular range and prep 
        // it for adding values
        var rng = sheet.getDataRange().offset(i+1,0,1).getA1Notation();
        myRange = sheet.getRange(rng);
    
        //if stmt in For Loop
        if ( approved != "Yes" ) {
          // Here we can just work with the row element itself
          row[5] = "Yes";
          // Because setValues expects a two dimensional array, 
          // we wrap our row in brackets to effectively convert it to one
          myRange.setValues([row]);
        }  // if stmt end curly 
        else if ( approved == "Yes" && sentEmail != "Yes" ) {
          // Same here as above
          row[6] = "Yes";
          myRange.setValues([row]);
          GmailApp.sendEmail("email@email.com", "subject", "body" + "whatever " + snapshot);
        }
        else {
          return;
        }
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following issue and I would really appreciate your help: I have
Can any body help me to convert the following SQL query in LinqToSql syntax.
Can any one help me how to sort rows by relevance for the following
Can any one help in transforming my xml though XSLT. I am new to
Can any body help me out how to clear the items in the list
I can't figure out what I'm doing wrong here. I have the following code:
This is a very wierd issue - any thoughts/help/hints would be greatly appreciated. Our
I want to do the following, and any help would be appreciated: Create a
im relatively new to ROR, and would like some help with the following code.
I'm pretty clueless on this issue at the moment so any help even small

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.