Skip to content

Latest commit

 

History

History
101 lines (62 loc) · 2.91 KB

README.md

File metadata and controls

101 lines (62 loc) · 2.91 KB
Български Deutsch English Русский Українська

SheetSchema

Release License clasp

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.

Installation

  1. Open your project in the Google Apps Script Dashboard.
  2. Copy the contents of the sheet-schema.js file and paste it into a new file in your Google Apps Script project.

Documentation

For detailed documentation, please visit the Wiki page.

Usage

Here are some examples of how to use SheetSchema:

Insert Schema

const sheet = SpreadsheetApp.getActiveSheet();
const fields = [ 'time', null, { name: 'id' } ];
const schema = SheetSchema.insertSchema(sheet, fields);

console.log(schema);

Retrieve schema

const sheet = SpreadsheetApp.getActiveSheet();
const schema = SheetSchema.getSchemaBySheet(sheet);

console.log(schema);

Retrieve field by column index

const sheet = SpreadsheetApp.getActiveSheet();
const schema = SheetSchema.getSchemaBySheet(sheet);
const field = schema.getFieldByIndex(0);

console.log(field);

Get field by name

const sheet = SpreadsheetApp.getActiveSheet();
const schema = SheetSchema.getSchemaBySheet(sheet);
const field = schema.getFieldByName('time');

console.log(field);

Deleting schema

const sheet = SpreadsheetApp.getActiveSheet();
const result = SheetSchema.removeSchema(sheet);

console.log(result);

Contribution

Please read CONTRIBUTING.md for details on how to contribute to this project.

Change History

Please refer to CHANGELOG.md for a detailed list of changes and updates.

License

This project is licensed under the LICENSE.md file.