Skip to content

Commit

Permalink
Attempting to clarify how rows work
Browse files Browse the repository at this point in the history
  • Loading branch information
TehShrike committed Jan 17, 2018
1 parent 2243d32 commit 79fc4cb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions readme.md
Expand Up @@ -105,15 +105,19 @@ getSheet('14uk6kljx-tpGJeObmi22DkAyVRFK5Z1qKmSXy1ewuHs', '0d6').then(sheet => {
})
```

In addition, you can also access values of a row by property name. In this example, the value in cell A1 is "First header":
Rows are arrays, like `[ 'Something\'s up', 'That\'s "cool"' ]` and `[ 'a3', 'b3', 'c3' ]`, but you can also access values in a row by using header names as properties.

In this example, the header name (defined by the value in cell A1) is "First header":

```js
getSheet('14uk6kljx-tpGJeObmi22DkAyVRFK5Z1qKmSXy1ewuHs', '0d6').then(sheet => {
const firstRow = sheet.rows[0]
firstRow.firstheader // => `Something's up`
firstRow.secondheader // => `That's "cool"`
})
```

See below to figure out the property names for a column.

### Column names/property names

The column names are generated by Google Sheets, not by this library.
Expand Down

0 comments on commit 79fc4cb

Please sign in to comment.