7 posts tagged with “utilities”

Assert Required Keys

The API call failed because row 37 had no email. Worse, it succeeded with an empty amount. assertRequiredKeys(obj, requiredKeys, opts…

Set Dropdown From List

Status columns full of “approved”, “Approved ”, and “APPROVED!!” break every script that reads them. setDropdownFromList(targetRange, source…

Flush Then Get Values

You write inputs, then read a formula cell that depends on them, and get the old answer. Apps Script batches writes, so the read can run…

Group Objects By Key

You have 200 rows and need one email (or one Drive folder, or one export) per client. Nested loops and “remember the last name” logic get…

Truncate For Cell

Sheets cells top out around 50k characters. Dump a full err.stack, UrlFetch body, or JSON blob with setValue and the run throws mid-flight…

Open By URL Or Id

Paste a whole browser URL into SpreadsheetApp.openById and the run dies. openByUrlOrId(urlOrId) accepts a Spreadsheet URL or raw id…

Format in Spreadsheet Timezone

Log stamps and export filenames that disagree with the sheet’s timezone are a classic bootstrapper footgun. formatInSpreadsheetTimezone(date…