Skip to content

Loads Google SpreadSheets using the csv export function

Notifications You must be signed in to change notification settings

Gnuelch/JS-Google-SpreadSheet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

JS-Google-SpreadSheet

Usage

File-Publish_Web Publish_CSV

  • Get The SpreadSheet ID in the now displayed url:
    • .../spreadsheets/d/e/verylongtext/pub?output=csv
    • .../spreadsheets/d/e/ verylongtext /pub?output=csv
    • verylongtext
  • Use the ID to create the Spreadsheet object
import GSpreadSheet from '/GSpreadSheet';

// the boolean value indicates whether the sheet has a header row

let sheetInstance = GSpreadSheet.fromExport('verylongtext', false, (sheet) => {
	let some_col = sheet.cols['column name'];
	let some_val = sheet.get('other column', 3);
	let alternative = sheet.cols[1];
	let some_row = sheet.rows[3];
	if (sheet.hasHeader){
		let headers = sheet.headers;
	}
});

// Now Also with API 'support'!

// as above, the boolean value determines whether the sheet (or range) has a header row

let sheetInstance = GSpreadSheet.fromAPI('API_ID', 'Target_Sheet_Name', 'API_Key', false, 'A1:G23', (sheet) => {
	// same as above
});

About

Loads Google SpreadSheets using the csv export function

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published