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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:04:37+00:00 2026-06-11T20:04:37+00:00

I have a uiApp that is creating table views from spreadsheet data, but I’m

  • 0

I have a uiApp that is creating table views from spreadsheet data, but I’m having difficulty with empty cells in a date column.

Basically, some of the spreadsheet cells are optional, and I haven’t figured out how to put no (or a null) value into the table. Right now it works if I set the column value to:

projectDataRaw[i][projectDataKeys[j]]= new Date(); // inserting dummy data

But I want to leave those cells blank in the table view too, however, when I use:

projectDataRaw[i][projectDataKeys[j]]= null; // 

Or some variation of that, it errors because the column type is set to DATE.
I could convert to strings, but I kind of wanted to be able to compare date values to each other when they are available.

— Example of issue with table view and null data —

// load data from sheet
var _PMsheet = "sheet key";
var sSheet = SpreadsheetApp.openById(_PMsheet);
var projectData = sSheet.getRangeByName("ProjectDateCol").getValues();

var projectDataTable = Charts.newDataTable();
projectDataTable.addColumn(Charts.ColumnType.DATE, "Date Column");

for (var i=0; i < projectData.length; i++) {
  if (projectData[i] == undefined || projectData[i] == "undefined") {
    projectDataTable.addRow([null]);// Object type does not match column type.
    // null fails, "undefined" fails, "" fails, [] fails 
  }
  else {
    projectDataTable.addRow([projectData[i]]); // this cell has a valid date obj
  }

}
  • 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-11T20:04:38+00:00Added an answer on June 11, 2026 at 8:04 pm

    I created a simple script which writes null to the A1 cell and current date to the A2 cell. The complete column A is validated to be a date time. After the script execution the cell A1 is empty even if it contained a value before and there is no any warning or error message.

    function myFunction() {
      var sheet = SpreadsheetApp.getActiveSheet();
      var rangeValues = [[null], [new Date()]];
      sheet.getRange("A1:A2").setValues(rangeValues);
    }
    

    If this example does not help you, please publish as smallest as possible working script which does not work as you expected.

    Update, basing on the author clarification: I wrote a simple script trying to find the problem cause and to find a workaround. The code is bellow. If to uncomment the data.addRow(['', 2.0]); line, then an exception thrown by the addRow method. It is an expected behavior. If to uncomment the data.addRow([null, 3.0]); line, then the chart.setDataTable(data) line throws an exception. This behavior is not correct, from my point of view, and I think it is necessary to report an issue to the issue tracker.

    Also there is a workaround of this problem by using the DataTableBuilder.setValue method. The code demonstrates it.

    By the way, the DataTableBuilder.setValue description in the documentation is not correct. It does not contain the column parameter. It is a topic to the issue tracker.

    function doGet(e) {
      var app = UiApp.createApplication();
      var chart = Charts.newTableChart();
      var data = Charts.newDataTable();
      data.addColumn(Charts.ColumnType.DATE, 'Date');
      data.addColumn(Charts.ColumnType.NUMBER, 'Value');
      data.addRow([new Date(), 1.0]);
    //  data.addRow(['', 2.0]); // throws the "Object type does not match column type" exception in this line.
    //  data.addRow([null, 3.0]); // throws the "We're sorry, a server error occurred. Please wait a bit and try again" exception in the "chart.setDataTable(data)" line.
      data.setValue(1, 1, 3.0);
      chart.setDataTable(data);
      app.add(chart.build());
      return app;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using UiApp to collect data from a form, but I have users double clicking
Have converted devise new session from erb to Haml but doens't work, this is
Have one Doubt In MVC Architecture we can able to pass data from Controller
Have data that has this kind of structure. Will be in ascending order by
Have data that has this kind of structure: $input = [ { animal: 'cat',
I have to generate labels from a list of user data stored in a
I have a spreadsheet with a UI app script. The app reads/updates from the
I have a database program on a spreadsheet with data classically ordered in rows
have 2 questions : A computer with 32-bit address uses 2-level page table (9
have a nice day. I got problem when trying to create an image from

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.