google-sheets icon indicating copy to clipboard operation
google-sheets copied to clipboard

Update a row

Open bernier opened this issue 10 years ago • 0 comments

Hi @benjamind, just wanted to bring something to your attention, not sure if it's a bug or if I'm doing something wrong at this point. When updating a row, only data can be modified. https://github.com/benjamind/google-sheets/blob/master/lib/rows.js#L162

So I use this code to update a row: rows.save(r, wObj, function rowObjectUpdated(err, r2) {//updated}); Where wObj is an object containing the columns/values (data format) { columna: 'data a3', columnb: 'data b', columnc: 'data c3', columne: 'e3' }

I believe the code starting https://github.com/benjamind/google-sheets/blob/master/lib/rows.js#L176 should be something like:

    for (var key in options) {
        if (options[key]) {
            document.ele('gsx:' + key)
                .txt(options[key]);
        }
    }

    this.query({
        url: row.editUrl,
        method: 'PUT',
        body: doc.toString()
    }, function(err, data) {
    //...

This updated code is working in my case.

Thanks!

bernier avatar Jan 09 '15 20:01 bernier