Need Help Comparing Data and Getting a Response from Google Sheets

52 views
Skip to first unread message

Tony Katzenberger

unread,
Mar 16, 2019, 3:31:38 PM3/16/19
to MIT App Inventor Forum
I have an app that I want to choose a product from multiple choices in Google Sheets Column 11 (this portion is working)
then
Choose another product from multiple choices in Google Sheets Column 12 (this portion is working)
then
click a submit button to find the Google Sheets row in column 13 and return the suggested product. (This is not working).

Google sheets is pre-loaded with data in columns 11, 12 & 13

Example:
sample 1 PickList=Baking Powder
Sample 2 PickList=Vinigar
suggested response TextBox=foaming
or
sample 1 PickList=Baking Powder
Sample 2 PickList=Water
suggested response TextBox=No reaction

Whereas "Baking Powder" is one item in column 11,  "Vinigar" & "Water" are items in column 12 and the suggested response is listed in column 13 next to each different product mix.


TimAI2

unread,
Mar 16, 2019, 5:08:58 PM3/16/19
to MIT App Inventor Forum
Use the same method to access Column 13 data as you do to access Columns 11 and 12, and bring all that data into a list in the app
Then compare your pick lists selections with that list ?

An example of your google sheet columns may help if I am on the wrong track here, e.g.
what logic from having picked "Baking Powder" and "Vinegar" generates the response "Foaming" ?

Tony Katzenberger

unread,
Mar 16, 2019, 5:30:15 PM3/16/19
to MIT App Inventor Forum
Thank you for your response. I'm almost brain numb with this project.

Here is a link to my blocks

TimAI2

unread,
Mar 16, 2019, 5:44:14 PM3/16/19
to MIT App Inventor Forum
And the google sheet content, just a few rows, to show the relationship between 11,12,13 ?
(Once I have this I can help with the blocks and lookup)

From your blocks the relationship between 11,12,13 is unclear

I am guess no relationship between 11 and 12 but 11 relates to 13 and 12 relates to 13 ?

I also wouldn't do the Lookup blocks like that, you will be there all day and it is hard coded
be better to use lists and lookup in pairs, if practical
Message has been deleted

TimAI2

unread,
Mar 16, 2019, 6:53:20 PM3/16/19
to MIT App Inventor Forum
Your last sentence just made this a bit more interesting (complicated) :)

If we just stick with the matter in hand you should be able to:

1. Select an item from Substrate1 (a filtered unique list)
2. Select an item from Substrate2 (filtered based upon selection in Substrate1)
3. Selected product should then be automatically selected

How does that sound ?

You can then test for the row in the google sheet that contains these three things in order to further populate the other columns (but that is easy to say!)

If you like the approach for the matter in hand, give me a while and i will come back with something, then we can tackle the rest!

Tony Katzenberger

unread,
Mar 16, 2019, 7:28:02 PM3/16/19
to MIT App Inventor Forum
That is exactly what I had in mind!


TimAI2

unread,
Mar 16, 2019, 7:40:39 PM3/16/19
to MIT App Inventor Forum
Here are some blocks i put together
(there are many ways to do this!)

I have attached an aia project file for you to play with

blocksgetuniquelists.png


uniqueListsSelect.aia

TimAI2

unread,
Mar 16, 2019, 7:49:07 PM3/16/19
to MIT App Inventor Forum

Tony Katzenberger

unread,
Mar 16, 2019, 7:59:53 PM3/16/19
to MIT App Inventor Forum
Thank you so much!! I will put this to work and learn... I have hours of work in to this before waving the white flag. Thank you again.

ABG

unread,
Mar 16, 2019, 10:36:45 PM3/16/19
to MIT App Inventor Forum
I did a similar lookup based on 2 columns earlier this week,
based on a static file and TinyDB.

ABG
Reply all
Reply to author
Forward
0 new messages