← Data apps

Data apps: recap

For after the lessons: one card per lesson, to check what you remember. Answer each question in your head or on paper first, then check it. Nothing here is marked.

Lists that must agree

1. Two lists that must agree

Try firstTwo lists: Names (Ana, Ben, Cy) and Scores (7, 4, 9). Ben is removed from Names only. What score does the app now show for Cy?

Check your answer

4: Cy moved up to place 2 in Names, and place 2 in Scores is still Ben's 4.

Parallel lists describe the same things: item 1 of Titles goes with item 1 of Artists, and so on. The place number is the only link between them.

So every change has to happen to both lists, at the same place: add to the end of both, remove the same item from both. Change one and every item after it lines up with the wrong partner.

Open the lesson →

Tables and records

2. One table instead

Try firstA table Books has the fields title, author and pages. What does one row hold, and what does item(Books, 3).author give?

Check your answer

One row holds one book's title, author and pages. item(Books, 3).author is the author of the third book.

A table keeps records: one row per thing (here, a song), one field per detail (title, artist, length). Every row has the same fields, and each field holds text or a number.

Add a row takes one value for each field, so a new song arrives whole. Remove row takes the whole row away, so a title can never lose its artist.

Open the lesson →

3. Records and fields

Try firstA table Scores has a field points. Write the three parts of an event that adds up every row's points into a variable sum.

Check your answer

Set sum to 0 on the event; a sub-event For each row in table Scores that adds LoopItem.points to sum; then a sub-event after it that shows sum.

A table is a list of records. A dot reads one field of a record: ClickedItem.title, item(Songs, 2).artist, LoopItem.length.

For each row runs once per row, and LoopItem is that row. A running total starts at 0 before the loop and adds one value per row. A best so far starts with the first row and swaps in any row that beats it.

Open the lesson →

Saving between visits

4. Saving between visits

Try firstYour app remembers a table of scores. A friend opens it on their own laptop. What will they see, and why?

Check your answer

Only the starting rows: remembered data is kept in the browser where it was added, not in the project or online.

Remember between visits keeps a value in this browser, so it's still there when the app is opened again on this computer. The project file still holds the starting values.

Test both visits: Restart is a return visit, and Forget saved data makes the next start a first visit. count(Songs) = 0 tells them apart.

Open the lesson →

5. A journal with drawings

Try firstA plant log keeps a photo of each plant every week. Why a table with a picture field, not a list of names and a separate list of photos?

Check your answer

One row keeps the name, the date and the photo together, so they can't get out of step when a row is added or removed. Two lists have to be kept matching by hand.

A table can have a picture field: each row keeps its own picture, shown as a thumbnail.

Add a row to Entries with value Chosen, note NoteInput.text and drawing Drawing.picture keeps all three together.

When a row is clicked, ClickedItem is that row, so ClickedItem.drawing is its own drawing.

💾 Remember keeps the rows and their drawings in this browser. A Share link carries the app, not what it kept; Save with what the app kept gives one file with everything.

Open the lesson →

Search

6. Search, filter and sort

Try firstDescribe, in steps, how to show only the books with more than 300 pages, without losing any books.

Check your answer

Clear a results table; for each row of Books, if pages > 300, add that row to the results table; show the results table. Books itself isn't changed.

Sort puts whole rows in order by one field: number fields by size, text A to Z.

Search and filter are one algorithm: clear a results table, go through every row, and copy the rows that pass a test. The original table is never changed, so nothing is lost. Only the test changes: contains(...) for a search, a comparison for a filter.

Open the lesson →

Final challenge: your own data app

7. Challenge: your own data app

Try firstWhat did your user try that you didn't expect, and what did you change because of it?

Check your answer

Any specific answer tied to what they watched, not a general opinion.

A data app keeps records in a table and helps someone find something out from them.

Plan the table first (fields and their types, with example rows), then build in small steps: add and show, remember, then search, filter, sort or total. Test by watching a real user without helping, and improve one thing based on what you saw.

Open the lesson →