Skip to content

Instantly share code, notes, and snippets.

Created Nov 19, 2014
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;
Copy link

elbertwang commented Feb 18, 2022

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment