Display data from Supabase
This section will guide you through the steps to display a list of book titles from a Supabase table on your Nowa screen.
Displaying data from a Supabase table
Before starting this process make sure you connected your Nowa project to a Supabase project (check Connect Supabase).
Step 1: Add a text widget
- Click the Widget button in the Nowa toolbar.
- Scroll or search to find the Text Widget and click to add it to your screen.
- Insert this widget inside a column (check how to it here: Columns and Rows)
Step 2: Add Data Builder
The next step is to wrap the column containing the text widget with the Data Builder wrapper.
- Select the column with the text widget.
- Click on the Add Wrapper button in the details panel.
- In the menu that appears, select Data Builder.
Step 3: Configure the Source
We need to configure the data builder to fetch data from Supabase.
- From the details panel of the wrapper, under the Source property, select Supabase.
- In the Table property that appears, select the table that you want to display from the drop down, in this case "books".
Step 4: Link the Children to the Data
Next, we need to link the children of the column to the data variable coming from the data builder.
- Select the column.
- Click on the Children property.
- In the menu that opens, select the corresponding data variable from the data builder.
Step 5: Link the Text Property to the Data
The last step is to display the book titles from the data builder in the text widget.
- From the outline, select the Text Widget that you added in step 1.
- Click on the Text property in the widget's details panel.
- In the menu select the data variable corresponding to the book title.
Congratulations! You've successfully set up your Nowa screen to display a list of book titles from your Supabase data source. Each time you open your screen, the data builder will fetch the most recent list of books from Supabase, ensuring that your data is always up to date.