Created
May 27, 2020 04:45
-
-
Save iaindooley/a8f5f90ba46b52eaac05505a4b0ffca7 to your computer and use it in GitHub Desktop.
Import spreadsheet data
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 importSpreadsheetData(event) | |
{ | |
var values = getSpreadsheetDataFromEventTrigger(event); | |
var board = new Trellinator().board("Production"); | |
board.lists().each(function(list) | |
{ | |
list.archiveAllCards(); | |
}); | |
for(var i = 0;i < values.length;i++) | |
{ | |
var target_list = board.findOrCreateList(values[i].column_name); | |
//data should contain a list of card names for example | |
for(var j = 0;j < values[i].data.length;j++) | |
{ | |
//create a card for each work item in the target list | |
Card.create(target_list,values[i].data[j]); | |
} | |
} | |
} | |
function getSpreadsheetDataFromEventTrigger(event) | |
{ | |
//this function deals with the google sheets | |
//api to get your data as an array following | |
//an "on edit" trigger or something similar, out | |
//of scope for this example code | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment