Skip to content

Trace data from database to page

Concept · Beginner · Core concepts

Follow a product list across the database, server action and page binding.

Follow a product list across the database, server action and page binding.

Use products with id, name and price as the example. This is a map of the flow, not a completed database tutorial. For a working first API without a database, follow Create your first Server Connect action in the beginner course.

Create an action that uses the project’s database connection and outputs a query named products. The action must include the required validation and access checks; returning JSON does not by itself make an endpoint secure.

Call the action and inspect the returned JSON before adding a table binding. Confirm that products is an array and that each item contains the expected field names and values. Fix a failed request or wrong query here first.

Add an App Connect Server Connect component named sc_products and select the action. Its returned data is available under sc_products.data. The component is a page-side loader; it is not another server action.

Bind the table-body repeat to sc_products.data.products. Inside that repeat, bind the name cell to the current item’s name. The outer expression chooses the collection; the inner expression chooses a field from each record.

Compare database/query results, JSON output and visible rows. Correct JSON with wrong repeated text usually means the page binding uses the wrong scope. Correct query logic with an empty response may mean the output step was not enabled. Use the practical table guide for the complete UI procedure.

You can locate where a missing or incorrect product value enters the data flow.