Basic
Creating an Instance
If you have created a GAS on a specific spreadsheet and want to work with that spreadsheet, you can create an instance as follows:
const gassma = new Gassma.GassmaClient();
Alternatively, if you have created a GAS in a location other than a spreadsheet, or if you want to work with a spreadsheet located elsewhere, you can create an instance by passing the target spreadsheet's ID as an argument:
const gassma = new Gassma.GassmaClient("XXXXXXXXXXXXXXXXXXX");
Initialization with an Options Object
When you need advanced configuration such as relation definitions or global omit, pass an options object:
const gassma = new Gassma.GassmaClient({
id: "XXXXXXXXXXXXXXXXXXX", // Optional
relations: {
// Relation definitions (see the relation definition reference for details)
},
omit: {
// Global omit settings (see the global omit reference for details)
Users: { password: true },
},
});
| Option | Description | Reference |
|---|---|---|
id | Spreadsheet ID (uses the active spreadsheet when omitted) | - |
relations | Relation definitions | Relation Definition |
omit | Global omit settings | Global omit |
defaults | Default values for fields | defaults |
updatedAt | Auto-update timestamps | updatedAt |
ignore | Field-level exclusion | ignore |
ignoreSheets | Sheet-level exclusion | ignore |
map | Field name mapping | map |
mapSheets | Sheet name mapping | map |
autoincrement | Auto-increment | autoincrement |