Help with dictionary Bild

Sample pre-loaded sheet to Media:

File->Download->Comma Separated Values (.csv)

Pick a Downlaoded file name and location (I used my desktop for my Pizza Sheet Menu)

In AI2 Designer, start an Upload File to the Media folder:

Choose File and go looking for what we just downloaded from Google Sheets


Select our CSV file and hit the Open button

Now AI2 wants us to say okay are we sure


Notice how AI2 now knows what file we are asking it to upload

Now look in the Media folder and look who's there:

We are done with the Google Sheet, and can move on to loading the csv file in blocks using a File.

Drag in a File component from the Storage Drawer of the Designer.

Then in the Blocks Editor,
look in Screen1 for a block that loads something from the Media folder


That BackGroundImage block came with a pre-loaded text block with our file name, so we will just use the good part:

We need some global variables:

This one is to hold the text we loaded from the file, in case we need to debug.
initialize global Menu_csv to

This one is going to hold the Ai2 table (list of lists) we got from the file.
initialize global Menu_Table to

This is going to hold the AI2 dictionary we load from the table:
initialize global price_dictionary to

App startup: Asking to read the File (The // tells AI2 to look in the Media folder, and AI2 typeblocking helps us enter the file name without typoes)

When the File data arrives:


The Menu item name is in column 2, and the price is in column 3 (look earlier in this thread to be sure)
The List View Elements are the menu item names.

After picking a Selection, we show the Selection and its price in Labels.

The source:
APizzaSheet.aia (3.2 KB)

The Designer:


(I dropped the ListView to the bottom to expose the Labels)

Sample run: