Data binding
Data binding allows you to associate any element of your application to a data source. You can bind a property, content, an action, etc. When the data changes, the associated element automatically reflects this change.
Here are some examples of data binding uses:
- Display the value of a user score
- Display an image from an Airtable database
- Trigger a condition based on text entered by the user
Data binding is present at all levels of your PandaSuite Studio interface.
Bind an element to data
In the Properties panel, click on the name of the property to bind. In the data binding window, select among several data sources:
- From a component: select any component in your application (it can be on another screen or even at the project level)
- From a data source: select a variable from the Datastore, an external source via the HTTP component, or a user-associated value via Firebase
- From the project: access properties defined at the Project level, including the current date & time
- PandaSuite identifier: unique identifier for the app installation on the device
- Random number: returns a random number between 0 and 1
You can transform the bound data using a function: count elements, extract an item by index, format a date, etc.
Below, the text block is bound to the value of the Text input component on the previous screen. As soon as the user enters their name, it appears in place of the lorem: