Read data from Google sheets

Hi,
I have table in Google Sheets, as below.


And, i want have all data from table to one od the people just like the picture below.

When i arregens blocks as shown on the picture below, all selected labels shows only one last items from the rów in the table.

Is there a way tor the app to her all informations for a given person?

1 Like

Here is an example of how to do this ( I used a csv file instead of a google sheet download, but the principle is the same):

listOut.aia (4.4 KB)

4 Likes

Perfectly!
But, what i need to change in bloks to make IT works with Google Sheets?
I try change but its bot worked on sheets :confused:

I don't know if i'm doing well

1 Like

You do not need to call the Web1.get again in the after Selecting event (red cross)
Where is the set Web1.Url block which sets the url for the google sheet ? (red arrow)

1 Like

In blocks editor i don't create web1.url blocks. I added url link in properties web1 in designer window

I solve it.
Sorry for the last posts.
I frogot to make the sheets protection visible to anyone with the link.
Now everything works: :smiley:
Thank a lot for the hint and answers :wink:

And have a nice day!

1 Like

I don't want to start a new topic. I only have a question, is it possible to read data from a sheet that is not publicly available? I would have to add login to google drive? Is it good idea?

1 Like

Query Any Google Sheet with a Web App

Post Data to a Google Sheet

Get or Download a Private Image from Google Drive

I do have another project on the go at the moment that will provide a user access to their own google drive.....

One more question about the topic came to my mind.
is there any way to delete or change entries from within the application?
for example, I see incorrect or redundant information in the downloaded data that I would like to delete or correct this.

1 Like

What you are talking about is a full CRUD (create/read/update/delete) for your spreadsheet.

A couple of methods:

How to use a Google Drive Google Spreadsheet as Database

CRUD with Google Sheets, Web App and AI2

How you do it will depend if your spreadsheet is public or private

Ok.
I'll check it.
Thanks again :wink:

I have theoretical question. I want to store lists of different lengths in individual lines of the sheet, one line will have, for example, 5 data (empty fields always at the end of the line) and the other line will have 10 data. Then I will download them to the application and convert csv to lists. Will the lists be of different lengths, one list of 5 items and the other of 10 items? Or maybe both lists will have 10 items, except that the next one will have 5 empty items? I am asking because I know that the csv table also contains empty cells.

I believe you will get a downloaded csv with each line having the number of entries for the longest entry in the sheet:

a,b,c,d,e,f,g
a,b,c,,,,,

Consider adding a new sheet to your design, with one row for each additional list item, identified by the key of its owner.

See the Order Item sheet in this Pizza Store sample, built for a (hopefully) upcoming Google Sheets component ...

Having the list items in a separate sheet, lined up in the same column, allows you to do some SQL-like grouping and summation.

Exactly. So the second list will have empty items at the end? Too bad there is no block for removing empty list items :upside_down_face: .

But then you would have an improper csv/listofLists

If you attempted to iterate over a list of lists with different lengths, AI2 would complain....

Suggested reading:
Data Normalization

I followed you but can't look up the data, please help

googlesheet

  • Are you certain your sheet is called sheet1 and not Sheet1 (uppercase S) ?
  • You don't show a query you have tested with
  • Is your script correctly deployed ?
1 Like