This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Gets all the unmerged ranges within a range. | |
* @param {SpreadsheetApp.Range} range The range to evaluate. | |
* @returns {SpreadsheetApp.Range[]} The unmerged ranges. | |
*/ | |
function getUnmergedRanges(range) { | |
if (!range.isPartOfMerge()) { | |
return [range]; | |
} | |
var mergedRanges = range.getMergedRanges(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as coda from "@codahq/packs-sdk"; | |
export const pack = coda.newPack(); | |
const ClientId = "..."; | |
const ClientSecret = "..."; | |
pack.addNetworkDomain("zendesk.com"); | |
pack.setUserAuthentication({ | |
type: coda.AuthenticationType.Custom, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Move events with a given title from your primary calendar to another calendar. | |
* You must enable the Calendar Advanced Service: | |
* https://developers.google.com/apps-script/guides/services/advanced#enabling_advanced_services | |
*/ | |
function moveEvents(eventTitle, fromCalendarName, toCalendarName) { | |
var fromCalendarId = CalendarApp.getCalendarsByName(fromCalendarName)[0].getId(); | |
var toCalendarId = CalendarApp.getCalendarsByName(toCalendarName)[0].getId(); | |
var now = new Date(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Converts an XML string to a JSON object, using logic similar to the | |
* sunset method Xml.parse(). | |
* @param {string} xml The XML to parse. | |
* @returns {Object} The parsed XML. | |
*/ | |
function xmlToJson(xml) { | |
var doc = XmlService.parse(xml); | |
var result = {}; | |
var root = doc.getRootElement(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as coda from "@codahq/packs-sdk"; | |
export const pack = coda.newPack(); | |
// TODO: Set domain and API key. | |
const ProjectDomain = "<subdomain>.supabase.co"; | |
const ApiKey = <apikey>"; | |
const ProjectUrl = `https://${ProjectDomain}`; | |
pack.addNetworkDomain(ProjectDomain); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sends an email using the contents of a Google Document as the body. | |
*/ | |
function sendDocument(documentId, recipient, subject) { | |
var html = convertToHtml(documentId); | |
html = inlineCss(html); | |
GmailApp.sendEmail(recipient, subject, null, { | |
htmlBody: html | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file A sample showing how to format date/time values in Apps Script so that they appear in the | |
* user's timezone. View a working version here: | |
* https://docs.google.com/spreadsheets/d/1VlI8HibL9kh_wlmO0G1ltMGVo6S-urGrDqDbfEp9eeY/edit | |
*/ | |
/** | |
* Add menu item after the spreadsheet opens. | |
*/ | |
function onOpen() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Change this values based on your spreadsheet. | |
var SHEET_NAME = 'Form Responses 1'; | |
var STATUS_COLUMN_NUMBER = 4; | |
var PROCESSED_STATUS = 'Processed'; | |
var LAST_ROW_KEY = 'lastRow'; | |
var LOCK_TIMEOUT_MS = 60000; // 1 minute | |
var MAX_RUNTIME_MS = 240000; // 4 minutes | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2019 Google LLC. | |
* SPDX-License-Identifier: Apache-2.0 | |
*/ | |
var CHECKBOX_COLUMN = 'B'; | |
function onEdit() { | |
var range = SpreadsheetApp.getActiveRange(); | |
if (range.getA1Notation().split(/\d/)[0] == CHECKBOX_COLUMN && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onOpen() { | |
DocumentApp.getUi().createMenu('Demo') | |
.addItem('Select Spreadsheet', 'selectSpreadsheet') | |
.addItem('Update Data', 'updateData') | |
.addToUi(); | |
} | |
function selectSpreadsheet() { | |
var result = DocumentApp.getUi().prompt('Enter the ID of the spreadsheet:'); | |
var spreadsheetId = result.getResponseText(); |
NewerOlder