GithubHelp home page GithubHelp logo

Comments (8)

Verdier avatar Verdier commented on September 7, 2024

+1 !

from node-edit-google-spreadsheet.

Shuyinsama avatar Shuyinsama commented on September 7, 2024

+1 I need this so badly :D

from node-edit-google-spreadsheet.

andreconrado avatar andreconrado commented on September 7, 2024

+1

from node-edit-google-spreadsheet.

adriank avatar adriank commented on September 7, 2024

Hello!

I'm mostly interested in autocreation of worksheet e.g.:

gs.load({
    ...
    worksheetName: "MySheet"
    ...

should silently create MySheet instead of throwing error: "worksheet 'MySheet' not found". It could be configured like that:

gs.load({
    ...
    autoCreateWorkSheets:true,
    worksheetName: "MySheet"
    ...

The simplest thing that would work seems to be just calling G API with:

POST https://spreadsheets.google.com/feeds/worksheets/key/private/full
Content-Type: application/atom+xml

<entry xmlns="http://www.w3.org/2005/Atom"
    xmlns:gs="http://schemas.google.com/spreadsheets/2006">
  <title>Expenses</title>
  <gs:rowCount>1000</gs:rowCount>
  <gs:colCount>20</gs:colCount>
</entry>

https://developers.google.com/google-apps/spreadsheets/#adding_a_worksheet

It would be awesome if you could add this feature to the library, but if you are too busy could you share some hints on how to avoid headaches associated with G API and where to insert this call in the code?

Thanks :)

Adrian

from node-edit-google-spreadsheet.

jpillora avatar jpillora commented on September 7, 2024

@adriank I'd opt for the passing a create boolean option. You're right about me being busy :( Haven't used this library in about 2 years and haven't written any Node for about 1 year. Happy to help you get started with this though. In terms of hints, there's not much to add to the notes above. Did you have questions in particular?

from node-edit-google-spreadsheet.

adriank avatar adriank commented on September 7, 2024

@jpillora I also have trouble finding time to code anything recently. Will see if I find someone to add this feature.

BTW. Do you recommend using the library since it's 2 years old? Or is it better to use something else that is supported? Do you know any other library that deals with Google Apps? I'm interested in integrating many Google's APIs and the best solution would be one library that covers all of Google products:).

from node-edit-google-spreadsheet.

jpillora avatar jpillora commented on September 7, 2024

@adriank 3,109 downloads in the last month and only 1 reported bug which hardly anyone encounters. This library uses Google Sheets API version 3.0 so as long as that is supported by Google - this library should be fine to use.

from node-edit-google-spreadsheet.

blak3r2 avatar blak3r2 commented on September 7, 2024

Hey guys, I got started on adding a new worksheet feature.

I'm encountering an error from google... POST method does not support concurrency
i then found this mailing list post... and the guys solution was to remove the If-Match: * on the headers. This unfortunately doesn't work and just results in If-Match or If-None-Match header or entry etag attribute required, I think this worked with protocol version 1. If I changed the protocol version, then the .load method fails to find the spreadsheet so i kinda gave up on that approach.

Any ideas?

Spreadsheet.prototype.addWorksheet = function(worksheetTitle, callback) {
  var url = 'https://spreadsheets.google.com/feeds/worksheets/' + this.spreadsheetId + '/private/full';
  var payload = '<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gs="http://schemas.google.com/spreadsheets/2006">' 
          + '<title>' + worksheetTitle + '</title>'
          + '<gs:rowCount>50</gs:rowCount>'
          + '<gs:colCount>10</gs:colCount>'
          + '</entry>';

  var opts = {
    url: url,
    body: payload,
    method: "POST"
  }

  this.request(opts, function(err, result) {
      if(err) { callback(err); }
      else {
        console.log(result);
      }
  });
}

from node-edit-google-spreadsheet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.