Reading data from google sheets from one column in spinner list and values from the same row in other Lables

Hello. I come to you with such a problem. I'm trying to create a shopping calculator based on Goggle Sheets. In the spreadsheet, I have the product name in the first column and its price in the second. In the app, the product list is in a Spinner. After selecting a product, its price must automatically be displayed in the other Label. I already have a list of products, but I can't figure out how to extract and automatically display the price of the product and the points awarded for it in other Labels.. Maybe someone has already done this type of solution and could help me.
Thank you


Sheets

Many, many times :wink:

You do not show your (complete) Web1.Url ?

Also this might help you:

The Web1 URL is shown in the WEB1 Properties in the Designer menu.

Yes, I have read this guide before, but I don't see how, when selecting a product from the spinner list, it can automatically read the value of the cell for it from the second column.
For example, according to the blocks shown, I have a spinner list with Products from A to H. When selecting Product D from the list, I need the value of cell B5 to be displayed in Label1 and the value of cell C5 in Label2.

Which is why I asked for the Web1.Url.

Are you fetching all the sheet data or just the product list ?

Ouch, sorry. I thought you were just informing me that I did not provide the URL to Web1 in the application.
Please, the address for the spreadsheet is provided in the application URL

Yes, but I don't know how to break it down so that they are connected but displayed in separate places. Currently, these are all the blocks I have in the application (I'll start with the one that causes the most problems).

This is a sample shopping cart, based on TinyDB Namespaces

If you download your price list into a dictionary (name/proce), you can use that as your price list.

1 Like

I would like to avoid having the data source be on the phone, but for me it is important that it be in the cloud, so that me and my wife have access to the same data even if one of us changes it. When I get back from work, I'll take a look at this code and maybe I'll find something useful from it. Thank you very much for the idea, eventually I may have to use this solution, but for now I'm not giving up and I'm looking for a spreadsheet option.

Here is one approach:

simpleGSData.aia (3.5 KB)

You could just call back the product names, then make a query to the google sheet to return the other values.

1 Like

Word of caution

AI2 numbers use decimal points (.) not commas (,)

1 Like

For multiple updaters use a detail sheet with timestamped increments, and a sheet of item summaries wired off the details.

This turns updates into atomic row additions.

Search this board for my Marathon sample.

1 Like

Thank you very much. This is exactly what I was looking for. I owe you a good beer :).

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.