How do you make a list do certain actions when each item is chosen

I'm trying to create a list picker that allows users to choose a new theme for the app based on their selection from a list. Where I am coming short is figuring out how to make it so that when, for example, "red and black" is chosen from the list picker, it runs the blocks to set the background, etc. I'm fairly new to app inventor so I'm sure I'm missing something fairly obvious but I'm stumped. Is there a way to make this happen using lists?


One thing you will need is a way to map from text names of colors to the actual color values.

This sample app lets you load a table of color names and codes from the Media folder, choose a color name from a List Picker, and display that color. (Thanks to @SteveJG for the color file.)

color_codes.txt (2.4 KB)
Colors.aia (6.7 KB)

initialize global table_text to

The next thing you will need to deal with is keeping a list of components whose colors you want to change, and how to use the Any (Generic) blocks to change the color of each component as you walk the list using a FOR EACH block.

To see code like that at work, see

1 Like

Wow, thank you!