Read data from Google Sheet

Hi,

Is there any way to read data from Google sheet?
I want to take data in column 2 (countries) and 4 (new cases) from this file https://docs.google.com/spreadsheets/d/1mpC--JsHI9sdo9RDbLUGwTT_eoaV0DlgQKFsV3BQBLk/edit?usp=sharing

Thank you for your time and I appreciate your help.
Trang

You have a choice. You cannot fetch non adjacent columns as a csv, therefore you either have to make two calls to the spreadsheet, or you can set up a helper sheet on the spreadsheet to show just these two columns.

Use the web component GET block, and collect the output in responseContent in the GotText event block. This assumes your spreadsheet is set to "anyone with the link can view".

The url you need for each column is:

https://docs.google.com/spreadsheets/d/1mpC--JsHI9sdo9RDbLUGwTT_eoaV0DlgQKFsV3BQBLk/export?format=csv&gid=0&range=B1:B

https://docs.google.com/spreadsheets/d/1mpC--JsHI9sdo9RDbLUGwTT_eoaV0DlgQKFsV3BQBLk/export?format=csv&gid=0&range=D1:D

If you only want to make one call, then create a new sheet on the spreadsheet, and put this formula in cell A1

={Sheet1!B1:B,Sheet1!D1:D}

Check the gid number for Sheet2 then use this url:

https://docs.google.com/spreadsheets/d/1mpC--JsHI9sdo9RDbLUGwTT_eoaV0DlgQKFsV3BQBLk/export?format=csv&gid=<GID FOR SHEET2>&range=A1:B

It´s very interesting

Greetings, I do not know if it is what you need, but I found this video, apparently it works perfect. review and comment

More about writing to a google sheet than reading....

Trang.aia (1.5 MB)

Trang.aia is nice.
It works off a Google sheet, downloads it as csv,
and builds a list of country names for a country list picker,
and looks up stats for that selected country by SelectionIndex.
For the benefit of readers, here’s a summary:

I would have done the clipping of the bottom and top of the table in a loop,
removing index 225 until the length of list is 224, then removing index 1 nine times.

@MySof_AR please do not post any aia file without further explanation
thank you @ABG for taking some time to provide what was missing

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

Thank you, Master @Taifun. Ok.

1 Like

A post was merged into an existing topic: Read data from Google sheets