Created
April 17, 2019 09:56
-
-
Save iaindooley/3cfdd7c089b8122672e9c93396188c24 to your computer and use it in GitHub Desktop.
Create cards from Sheet
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 createCardsFromSheet() | |
{ | |
var data = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("My Data").getDataRange().getValues(); | |
var my_board = Board.findOrCreate("My Data"); | |
if(data.length) | |
{ | |
var column_names = data[0]; | |
for(var i = 1;i < data.length;i++) | |
{ | |
var card = Card | |
.create(my_board.findOrCreateList(data[i][0]),data[i][1]) | |
.setDescription(data[i][2]); | |
for(j = 3;j < data[i].length;j++) | |
{ | |
if(data[i][j].trim()) | |
card.setCustomFieldValue(column_names[j],data[i][j]); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment