Skip to content

Instantly share code, notes, and snippets.

@dangtrinhnt

dangtrinhnt/utils.gs

Created Nov 19, 2014
Embed
What would you like to do?
Convert row data to dictionary using Google Apps Script
function rowToDict(sheet, rownumber) {
var columns = sheet.getRange(1,1,1, sheet.getMaxColumns()).getValues()[0];
var data = sheet.getDataRange().getValues()[rownumber-1];
var dict_data = {};
for (var keys in columns) {
var key = columns[keys];
dict_data[key] = data[keys];
}
return dict_data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment