Retrieving All Values from All Sheets from URL of 2PACX- of Web Published Google Spreadsheet using Google Apps Script and Javascript
This is a sample script for retrieving all values from all sheets from URL of 2PACX- of Web Published Google Spreadsheet using Google Apps Script and Javascript.
In this post, it supposes that the Google Spreadsheet has already been published for Web. Ref
Flow
The flow of this method is as follows.
- From the client side, send the URL of web published Google Spreadsheet to the Web Apps created by Google Apps Script.
- The URL is like
https://docs.google.com/spreadsheets/d/e/2PACX-###/pubhtml.
- The URL is like
- Return the byte array of XLSX data from the Web Apps to the client side.
- At the client side, the XLSX data is parsed with SheetJS js-xlsx.
- Retrieve all values from all sheets.
Usage
1. Prepare script.
Please copy and paste the following script to the script editor and save it.