Help me solve a randomize list problem

Hello I'm trying to create a simple app where there is a list of area using a spinner after picking an area and pressing a button it will randomly generate a restaurant name thankyou please help me ASAP :smiley:

appreciate your help

Welcome @itzderper


to select a random item from each of your area lists.

yeah I'm gonna use it later when the generate button is clicked my question is how do I split the data if the spinner set to branch campus it will only select the data of restaurants names in the branch campus area and if I selected the main campus in the spinner it will output data of the restaurant names in the main campus area

You need a two column table pre-loaded with

  • column 1: campus area name
  • column 2: restaurant name

Load the different unique area names from Column 1 into your Spinner (I like List Pickers better).

After picking an area name, filter the table to get only those rows for that area name using a list block.

Then pick a random row from the resulting table, and show its restaurant name.

sorry what do you mean by pre-loaded im very new to MIT app inventor

Here is a sample of pre-loading a table:

how does the logic work when if I selected area 1 it will random a restaurant name

You did not make a two column table.

im so sorry I still dont understand :frowning:

does this works? :smiley:

Please read up on tables.


Learn the difference between Elements and Selection.

Also study

and apply Do It to everything in those if/then blocks.

i did it like this and it kinda worked :smiley:

1 Like

okay i have another question what if I want to assign images.png to blue teppanyaki ? can i put it together or what thankyou !

You can use the blue gear in the if/then block to add more elseif branches.
It's called a Mutator.

but.. i already tested it if the output is blue teppanyaki it doesn't display the png

(Canned Reply: ABG- Export & Upload .aia)
Export your .aia file and upload it here.




project2.aia (25.7 KB)

thankyou somuch for ur help