Listpicker and Google sheets

Hi,

I am currently working on building a keyword definition app in which people can open a subject, say Geography, and then be able to see keyword according to the topic given in a list picker. I would also like there to be an option where they would be a to view all keywords for the subject. I have managed to program one for the user viewing all keywords, but am struggling to program one for viewing keywords based on a particular topic from the list picker. The definitions are stored in a Google sheets database. I’ve attached a screenshot of my code below..

image
image

The “Geo_topics” is my list picker and when I select a topic using that, it shows up a runtime error or sometimes the argument is not valid error. How can I fix that?

1 Like

We cannot see your code properly. To correctly download your blocks, right click in the Blocks editor and select "Download blocks as Image".

1 Like

1 Like

I have attached a screen recording of the issue.

I am using Android version 8.1.0 and the Companion version is 2.62

1 Like

Something has gone wrong in the AfterPicking event. Check it again.

1 Like

I see! I changed the “get global keyword” to “get global table” but it still doesn’t show the correct keyword and definition from the database. Could it be that my database isn’t organised correctly? I’ve added a screenshot of that. The first column is for all keywords and the other columns starting from Climate Change are meant to be the subtopics

1 Like

Make a right mouse click on this block → Do it & post the result:

grafik

1 Like

See here:

1 Like

Adding columns for subtopics gets awkward.

Instead, I recommend an organization that adds rows as the subject matter grows, like in this sample:

In this sample, the neighboring regions can be considered subtopics, and the subtopic nesting can be limitted only by the number of rows you add to the table.

2 Likes

Oh okay, thank you. I’ll try doing that with my document

1 Like


This was the result

1 Like

Instead of going this way, why don't you store the keywords in another global list. So when user picks any item from listpicker, with the help of index just get the keywords from the new variable

1 Like

In that case, would I need to create a list for each of the subtopics? Because when the user chooses from the list picker, then there would be another list of keywords to choose from.

1 Like

and post the (Do it) result of Label5.Text

1 Like

1 Like

grafik

1 Like

Have I done this right?

1 Like

It seems to be you are Doing It before calling

procedures_callnoreturn

http://ai2.appinventor.mit.edu/reference/other/testing.html

3 Likes

I called the procedure and then clicked “do it” and this was the result:

1 Like

You have to do the same steps as you have shown in the video.

1 Like