Created
March 26, 2019 06:31
-
-
Save iaindooley/34b1dd8f48a3a087baeb62cac5ab6fdd to your computer and use it in GitHub Desktop.
Aggregate numbers from Custom Fields
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 aggregateNumbersDaily(board,signature,original_time) | |
{ | |
//Create a new sheet in the document for today's date | |
var sheet = SpreadsheetApp.getActiveSpreadsheet().insertSheet(Trellinator.now().butlerDefaultDate()); | |
var board = new Board(board); | |
var fields = board.customFields(); | |
//Loop through all the Site Diary cards for Location 1 | |
board.list("Location 1 Site Diary").cards().each(function(card) | |
{ | |
//Create a row that has card name, and the values of each custom field | |
var current_row = [card.name()]; | |
fields.each(function(field) | |
{ | |
current_row.push(card.customFieldValue(field.name())); | |
}); | |
//append the row to the sheet | |
sheet.appendRow(current_row); | |
}); | |
//Run again at the same time tomorrow | |
ExecutionQueue.push("aggregateNumbersDaily",board,signature,original_time.addDays(1)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment