0

I'm building a Polymer app and I'm trying to load all spreadsheets from a google drive account but am having trouble. I can bring individual spreadsheets in at a time, but is there a way to bring all in at once? The docs(attached) say it is possible by leaving out the key but i'm not having any luck. Please find my code below. Any help would be much appreciated. Justin

my-dashboard.html

The below works for individual spreadsheets

<google-sheets
        key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
        client-id="XXXXXXXXXXXXXX.apps.googleusercontent.com"
        rows="{{rows}}"
        published >
    </google-sheets>

    <my-googlesheets-element rows="{{rows}}" user="[[user]]"></my-googlesheets-element>

my-googlesheets-element.html

<dom-module id="my-googlesheets-element">
  <template>
    <style></style>
    <h1>google sheet comp here</h1>

    <template is="dom-repeat" items="{{rows}}">
      <div id$="[[item.$key]]">
        <p>{{item.gsx$author.$t}}</p>
      </div>
    </template>

  </template>
  <script>
    Polymer({
      is: "my-googlesheets-element",
      properties: {
        rows: {
          type: Object
        },
      },
      observers: [ 'logRows(rows.*)' ],
      logRows: function() {
        console.log('rows data', this.rows)
      },
    })
  </script>
</dom-module>
RuNpiXelruN
  • 1,850
  • 2
  • 17
  • 23
  • The docs say that leaving out the key will return a LIST of spreadsheets, not the actual spreadsheets themselves. – pinoyyid Nov 30 '16 at 09:14
  • 2
    @RuNpiXelruN The [`.spreadsheets`](https://beta.webcomponents.org/element/GoogleWebComponents/google-sheets/google-sheets#property-spreadsheets) property provides the metadata list of spreadsheets available in Google Drive. You could parse the IDs from the list and then fetch each spreadsheet. – tony19 Dec 01 '16 at 00:07
  • @pinoyyid I know but leaving it out returns an error. Completely lost on this one? – RuNpiXelruN Dec 03 '16 at 08:10
  • @RuNpiXelruN In my tests, omitting the `key` made no difference to the value of the `spreadsheets` property. It's always populated with the metadata list. What is the error you see? – tony19 Dec 03 '16 at 11:24

0 Answers0