Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Created April 17, 2019 09:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iaindooley/3cfdd7c089b8122672e9c93396188c24 to your computer and use it in GitHub Desktop.
Save iaindooley/3cfdd7c089b8122672e9c93396188c24 to your computer and use it in GitHub Desktop.
Create cards from Sheet
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