SheetSchema is a Google Apps Script library that provides an easy way to work with sheet schemas in Google Sheets.
It allows you to define, insert, extract and manage schemas in Google Sheets, making it easy to maintain structured data.
Note! Using this service may increase script execution time.
- Open your project in the Google Apps Script Dashboard.
- Copy the contents of the sheet-schema.js file and paste it into a new file in your Google Apps Script project.
For detailed documentation, please visit the Wiki page.
Here are some examples of how to use SheetSchema:
const sheet = SpreadsheetApp.getActiveSheet();
const fields = [ 'time', null, { name: 'id' } ];
const schema = SheetSchema.insertSchema(sheet, fields);
console.log(schema);
const sheet = SpreadsheetApp.getActiveSheet();
const schema = SheetSchema.getSchemaBySheet(sheet);
console.log(schema);
const sheet = SpreadsheetApp.getActiveSheet();
const schema = SheetSchema.getSchemaBySheet(sheet);
const field = schema.getFieldByIndex(0);
console.log(field);
const sheet = SpreadsheetApp.getActiveSheet();
const schema = SheetSchema.getSchemaBySheet(sheet);
const field = schema.getFieldByName('time');
console.log(field);
const sheet = SpreadsheetApp.getActiveSheet();
const result = SheetSchema.removeSchema(sheet);
console.log(result);
Please read CONTRIBUTING.md for details on how to contribute to this project.
Please refer to CHANGELOG.md for a detailed list of changes and updates.
This project is licensed under the LICENSE.md file.