0

I am making a tool to be hosted on GitHub Pages that will analyze numbers from a spreadsheet in a particular way from any user-provided link to a published Google spreadsheet. I tried using the Google Sheets API, but it seems needlessly verbose since all I need to do is read in data from a published spreadsheet.

I am agnostic to the form the data starts in, so long as I can parse it reasonably easily into a 2d array.

For reference, here is an example of a published spreadsheet.

K1nesthesia
  • 147
  • 1
  • 3
  • 11
  • 1
    The google sheets API may be verbose but there aren't many other solutions... You can download the contents as a CSV or as JSON but I am not sure if you can do that programatically. – Tino Caer Jul 05 '20 at 22:54
  • @TinoCaer Yes, my current solution is to ask the user to download their sheet as a CSV file and then upload it through a file input element, but if there's a way to short circuit that process, it would make the app much more useful. The main issue I have with the API is not necessarily the verbosity, but the auth process, which is enough of a use barrier that I may as well stick to the CSV upload. If there really is no solution that doesn't use the API, I will take a second look at it. – K1nesthesia Jul 05 '20 at 23:08
  • Can I ask you about your question? 1. In your question, is [this thread](https://stackoverflow.com/q/62732791/7108653) useful?2. Your this question is to retrieve the values from the web published Google Spreadsheet. Is my understanding correct? – Tanaike Jul 05 '20 at 23:11
  • @Tanaike Somewhat, yes, but my application needs to be agnostic to the spreadsheet that is to be used. In that question the programmer knows what sheet they want to use, but in my case, the user will submit the link to a published sheet. – K1nesthesia Jul 06 '20 at 00:38
  • 1
    Thank you for replying. I apologize for the inconvenience. In my proposal, I have proposed to use the Web Apps as the wrapper. So I thought that in this case, your URL of `https://docs.google.com/spreadsheets/d/e/2PACX-###/pubhtml` can be also used by modifying the Google Apps Script. How about this? I have one question. You want to use the constant URL of Google Spreadsheet? – Tanaike Jul 06 '20 at 02:23
  • @Tanaike I have a form that allows the user to submit the link to the published google spreadsheet that they'd like to analyze, so no, the url will not be constant, nor will the sheets be on the same account. – K1nesthesia Jul 06 '20 at 20:18
  • Thank you for replying. In your case, if the Spreadsheet is always published to Web, for example, how about retrieving the values by sending the URL of Spreadsheet like `https://docs.google.com/spreadsheets/d/e/2PACX-###/pubhtml`? In this case, the URL can be dynamically changed and the values can be retrieved. – Tanaike Jul 06 '20 at 22:15
  • I see, you mean use the solution in your linked answer with the user-provided url. That may work, I will let you know. – K1nesthesia Jul 08 '20 at 01:25
  • 2
    Does this answer your question? [Get data from Google Sheets without Sheets API](https://stackoverflow.com/questions/62732791/get-data-from-google-sheets-without-sheets-api) – Alessandro Jul 09 '20 at 11:09
  • 1
    Thank you so much @Tanaike! Your response to my other question combined with the answer you referenced above solved the problem! – K1nesthesia Jul 15 '20 at 02:39
  • @K1nesthesia Thank you for replying. I'm glad your issue was resolved. Thank you, too. – Tanaike Jul 15 '20 at 08:23

0 Answers0