You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+50-31Lines changed: 50 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,28 @@
5
5
## Restrictions
6
6
7
7
1. Data must have headings:
8
-
- in the *first row of the specified range*, if data is organized in rows
9
-
- otherwise, in the *first column*.
10
-
2. Only one collection. If there is more, only the *first* one will be taken into account.
11
-
3. Property names inside the collection must correspond to headings in a spreadsheet that must contain **only** letters, numbers, and underscores (_). Otherwise, the `transformHeadings` option must be provided in the `mv-storage-options` attribute.
8
+
- in the *first row of the specified range*, if data is organized *in rows* (i.e., one row = one set of data)
9
+
- in the *first column of the specified range*, if data is organized *in columns* (i.e., one column = one set of data).
10
+
2. The plugin can work with only one collection. If the app has more than one collection, only the *first* one will be used.
11
+
3. Property names inside the collection must correspond to headings in a spreadsheet. For example, if there is a row/column with the “year“ heading in the spreadsheet, to use data from this row/column inside the app, there should be the `year` property in the corresponding collection.
12
+
13
+
**Note:** The headings must contain **only** letters, numbers, and underscores (_). Otherwise, the `transformHeadings` option must be provided in the `mv-storage-options` attribute. In that case, the plugin will do its best to transform headings into [allowed names of properties](https://mavo.io/docs/properties#property-name-rules) automatically. For example, the “Month name” heading will be transformed into “month_name”.
@@ -27,6 +45,7 @@ The plugin supports *private spreadsheets* as well. However, to read data from a
27
45
|`sheet`| (*Optional*) A sheet title to read/write data from/to. If not provided, the first visible sheet will be used. <br /> **Note:** If there is no sheet with the specified name in the spreadsheet, it will be created while saving data. |
28
46
|`range`| (*Optional*) A range with data in *A1 notation*. If not specified, the plugin will try to find the first not empty range of cells with data. |
29
47
|`spreadsheet`| (*Optional*) A spreadsheet id. The value between the `/d/` and the `/edit` in the URL of a spreadsheet. By specifying this value, you can redefine the spreadsheet id the plugin got from the provided spreadsheet URL. In other words, you'll be able to work with another spreadsheet. |
48
+
|`options`| (*Optional*) The plugin supports a number of options for customizing the way it reads/writes data from/to a spreadsheet. The supported options are `formattedValues`, `dataInColumns`, and `transformHeadings`. For details, see the **Supported options** section below. |
30
49
31
50
**Note:** We recommend providing either *sheet title* or *range* to avoid extra network requests.
32
51
@@ -40,66 +59,66 @@ This is a string like `A1:B2` that refers to a group of cells in the sheet (the
40
59
-`A5:A` refers to all the cells of the first column of the sheet, from row 5 onward.
41
60
-`C2:2` refers to all the cells of the second row of the sheet, from column C onward.
42
61
43
-
Named ranges are also supported.
62
+
**Note:**Named ranges are also supported.
44
63
45
64
## Customization
46
65
47
-
The plugin supports a number of options for customizing the way it reads/writes data from/to a spreadsheet. You can specify these options by using the `mv-storage-options` attribute. To separate the options, you can use either commas or semicolons.
66
+
The plugin supports a number of options for customizing the way it reads/writes data from/to a spreadsheet. You can specify these options by using the `mv-storage-options` attribute. To separate the options, you can use either commas or semicolons. For example, `mv-storage-options="dataInColumns, transformHeadings"`.
|`formattedValues`| Determines whether values should be displayed according to the cell's formatting on the sheet (if this option is provided) or not. |
54
-
|`dataInColumns`| If provided, that indicates that data is organized on the specified sheet in columns. |
55
-
|`transformHeadings`| If provided, the plugin will convert headings so that they can be used as property names: will convert accented letters to [ASCII](https://en.wikipedia.org/wiki/ASCII), all the letters to lowercase, etc. **Hyphens and spaces will be converted into underscores.**|
73
+
|`dataInColumns`| If provided, that indicates that data is organized *in columns* (i.e., one column = one set of data) and the headings are **in the first column** of the specified range, not the first row. |
74
+
|`transformHeadings`| If provided, the plugin will convert headings so that they can be used as property names: will convert accented letters to [ASCII](https://en.wikipedia.org/wiki/ASCII), all the letters to lowercase, etc. **Hyphens and spaces will be converted into underscores.**For example, the “Month name” heading will be transformed into “month_name”.|
|`mv-gsheets-range-not-provided`| If there is more than one table with data on a sheet, you should provide a range with the needed data. For more information, see the plugin docs. |
62
-
|`mv-gsheets-empty-cells-in-headings`| It looks like not all your data has headings. Please, make sure that the row/column with headings hasn't got empty cells. |
81
+
|`mv-gsheets-bad-headings`| It looks like not all your headings can be used as property names. Please, make sure that all cells in the heading row/column are not empty and follow the property name rules (https://mavo.io/docs/properties#property-name-rules). In some cases, specifying the more narrow cell range and/or the transformHeadings option might help. The headings are: {headings}.|
63
82
|`mv-gsheets-login-to-proceed`| You must be logged in to save data to the spreadsheet. Re-login and try again. |
64
83
|`mv-gsheets-write-permission-denied`| You don't have permission to save data to the spreadsheet. |
65
84
|`mv-gsheets-read-permission-denied`| You don't have permission to read data from the spreadsheet. |
66
-
|`mv-gsheets-unsupported-data-structure`| It looks like your app's data has a structure that is not supported by the GSheets plugin. |
85
+
|`mv-gsheets-unsupported-data-structure`| It looks like your app's data has a structure that is not supported by the Google Sheets plugin. |
67
86
|`mv-gsheets-spreadsheet-not-found`| We couldn't find the spreadsheet you specified. |
68
87
|`mv-gsheets-no-sheet-or-invalid-range`| There is no sheet with the specified name in the spreadsheet, and/or the format you used to specify the data range is invalid. |
69
88
|`mv-gsheets-invalid-range`| The format you used to specify the data range for storing your data is invalid. |
70
-
|`mv-gsheets-no-sheet-to-store-data`| We couldn't find the {name} sheet in the spreadsheet and created it. |
89
+
|`mv-gsheets-no-sheet-to-store-data`| We couldn't find the ”{name}“ sheet in the spreadsheet and created it. |
71
90
|`mv-gsheets-small-range`| The range you specified isn't large enough to store all your data. |
0 commit comments