What is Data
The line between a mockup and a living app: data
2 min read
Design alone does not make an app. No matter how meticulously you draw it, if nothing happens when you tap and there is no real information on screen, it is just a picture of an app.
A real app remembers something — a to-do list, user settings, results fetched from the internet, and so on. This information that an app handles is its Data. The moment you bind data to your design, the screen fills itself in, and when the data changes, the screen changes with it. This is the line between a static mockup and a living app.
Two concepts: Schema and Data
When working with data, it helps to distinguish two things.
- Data Schema — the shape of the data. It defines which fields the data is made of. (e.g. a to-do is made of
titleanddone) → Data Schema - Data — the actual values that go into that shape. (e.g. "Buy milk", not completed)
Creating data
In the Data section of the left panel, you create the data your app will use. Each field has a type.
- string — text
- number — a number
- boolean — true/false
- object — a structure grouping several fields
- reference — a reference to another Data Schema
- enum — one of a predefined set of values (Data Enum)
- image / color — image and color resources
Single value and array
Every field can hold a single value, or it can hold multiple values as an array (Array). For example, an "app name" is fine as a single string, but a "to-do list" needs to hold many items, so you make it an array. When you bind an array to a List, cells automatically repeat for as many items as there are.
The scope of data: project and page
When you create data, you place it in one of two scopes.
- Project data — accessible anywhere in the entire project.
- Page data — accessible only within that Page. It is also important because it serves as the data structure received when navigating between screens. (You can pass data to another Page using Action Flow Parameters.)
For complex data with several fields (to-dos, users, products, etc.), it is best to first define the shape with a Data Schema, then create data of that type.