Spinner dependent dropdown list

I am working on a demo project that uses gviz query to return dependent drop downs from google sheets, hope to get it finished today....

1 Like

Really grateful for same.

This demo project uses the gviz query language to retrieve data from a google sheet. There are no dependent drop downs on the google sheet, this is all handled by the app and the gviz queries. One assumes that the app user will not need to create stock items, so this is not included in the app. The spreadsheet owner can categorise their stock items from category lists on the spreadsheet. Only stock items will be used to generate the dependent drop downs on the app. To select an item or items using all four categories in my demo will therefore require 5 calls to the google sheet. (This is far too many for my liking, but given the desire to use a google sheet for this work....)

Stock Sheet

Category Listings

Blocks

All Stock Items

Category Selected Item

Screenshot 2022-10-16 12.22.05

Working Demo App

ShopSelections (2).aia (25.6 KB)

open for questions :wink:

Credits @KevinKun for the Tableviewer extension, used to display the stock items

6 Likes

This is exactly what am expected for... am delighted to see same...

Just for to understand more

For gid if am create global variable do it will work for same? Am going to try for same. Yes.

If dependent drop down changed the cell value, then would it reflect in next in spinner as its will or will invalidate next all entries? As will not dependent dropdown then...

If you mean the gid for the worksheet, then saving it to a global variable will work just the same.

In fact, the actions in Web2 are not needed ( I made some significant changes and the call is no longer necessary - my original aia project and blocks image updated)

You will need to explain this, I do not understand...

(added to new gviz section of)

1 Like

Had tested this too so as expected.

This is too tested and perfect.

Please remember that this is a demo. In its current state it would not be useful in production, because with many many stock items things may start to slow down when loading the data / images. You should consider the RecyclerView extension for display, and cache first time images for reuse. In essence, there would be a lot more to do to create a workable app.

Again, you might want to consider using SQLite, download all the stock data to an SQLite database, and conduct the queries locally on the device/app....

Yes Agree. Am trying to push this block for the page only filter work for dependent data for today's date only.

One question- If I have to set text piece for textbox 3 for create/update with '@" and textbox 5 for create/update with numbers with no decimal then where to set that block with notifier & If then....

Yes. that's very much needed & taking same. Thanks for same.

Sorry, do not understand, show relevant blocks or diagram of what you want to do


like this.

this will control specific input in create/update for specific format like must have @ or must have number or must have piece of text "https://drive.google.com/file/d/"

Well, did you try it? Did it work ?

Usually, it is better to try things out, then ask a question if it doesn't work as expected....

that's exactly what I did. but I can't write code to go from spinner1 select to the exact global variable that becomes spinner2 elements. can you help me?

I realized that the example I wrote was not helpful in explaining my need. I try one last time.
I created a general variable that contains a list of about ten items: this general variable becomes "spinner 1 elements".
I then created another seven general variables, each of which contains as many lists, each with about ten items.
one of these seven general variables will become "spinner 2 elements" based on "spinner 1 selection"
Therefore, I need help to write the code that allows me to insert the correct general variable, one of the other seven, into "spinner 2 elements".

Here is a "simple" example of spinner dependent dropdowns. I strongly recommend that you use a spreadsheet or csv file to collate and maintain your lists, rather than trying to build them inside the app with list blocks.

spinnerDDExample.aia (3.8 KB)

1 Like

Noooo! I don't believe it! I've just read your code and...
I'm refraining from jumping for joy: despite being a beginner, I have the impression that you hit the spot (in Italy they say inn like this...), solving my problem :slight_smile:
Now I'm not at home (it's now 2.40 pm in Italy) but tonight, before having dinner, I'll dive into the computer and hope to... :slight_smile:
Noooo! I don't believe it! I've just read your code and... I'm refraining from jumping for joy: despite being a beginner I have the impression that you hit the spot (in Italy they say inn like this...), solving my problem :slight_smile: Now I'm not at home (it's now 2.40 pm in Italy) but tonight, before having dinner, I'll dive into the computer and hope to... :slight_smile:

[image]
Thank-you

[image]

Dear Timai2, You're a myth!
I just tried with AICompanion the app you sent me and it works perfectly :slight_smile:
Now I will proceed immediately to modify the code I wrote.
You have earned yourself a dinner: when you come to Rome you will be my most welcome guest :slight_smile:
Thank-you
[image]