No need to extact the value to determine if the cell is empty. Google Spreadsheet API already has a method for this: Range – isBlank method
var cell = r.getCell(rws-1, 10);
if (cell.isBlank()) {
cell.setValue("foo");
}
More Related Contents:
- Apps Script: how to get hyperlink from a cell where there is no formula
- Refresh data retrieved by a custom function in Google Sheet
- How to automatically import data from uploaded CSV or XLS file into Google Sheets
- Create Google Calendar Events from Spreadsheet but prevent duplicates
- ultimate short custom number formatting – K, M, B, T, etc., Q, D, Googol
- How do I make a Sidebar display values from cells?
- Google Apps Script: How to set “Use column A as labels” in chart embedded in spreadsheet?
- Google Spreadsheet SCRIPT Check if edited cell is in a specific range
- button click is only working on Windows & not working on Android mobile sheet
- Custom functions intermittently hang with “Error – Loading Data”
- Retrieving Google Sheets cell border style programmatically
- How do I add formulas to Google Sheets using Google Apps Script?
- Deleting rows in google sheets using Google Apps Script
- Delete a row in Google Spreadsheets if value of cell in said row is 0 or blank
- Google apps script to email google spreadsheet excel version [duplicate]
- Margins parameters for Google spreadsheet export as PDF
- Hidden field in a Google Form
- Measurement of execution time of built-in functions for Spreadsheet
- onEdit() doesn’t catch all changes
- Converting .xls to google spreadsheet in google apps script
- Adding a property to an Html template gives error “Object does not allow properties to be added or changed”
- Use script in all spreadsheets
- Iterate over range, append string to each
- Can the google spreadsheet ‘query’ function be used in google apps script?
- How to pause App Scripts until spreadsheet finishes calculation
- How can I merge multiple tabs in a Google Spreadsheet using Google App Script?
- Custom Functions and Recalculation
- How to create INDIRECT array string of multiple sheet references in Google Sheets?
- Can the google spreadsheet ‘query’ function be used in google apps script?
- google script openById : You do not have permission to perform that action