Displaying data

A data provider component fetches data and provides it to all child components. Any child components which take in data to display have a simple setting for which data provider is providing their data. You can hook up as many components as you like to the same data provider, and they'll all be in sync with each other.

Data providers have settings to control filtering, sorting, and pagination. Because all of these data settings are handled by the data provider, it keeps all components as purely presentational. You can update the source of your data provider and your whole dashboard will instantly reflect an entirely different table!

Fetching data

📘

To fetch and display data within your user interface, you need to use the Data Provider.

After adding a Data Provider, you must navigate to the settings panel (the right panel) select a data source - the dropdown beside the label data. See the image below:

 


 

Displaying data (multiple records)

After adding a data provider and selecting a data source, the next step is to add a component that allows you to display your data. In many cases you will probably use one of the following components:

After adding a data provider, chart, and table, your component tree would look like:

Notice, in the image below, how the one data provider supplies two components with data:

 

Display user specific data

Sometimes, when building apps, you only want to display the data related to the user. For example, only show the sales records created by the user (specific salesperson). To do this, using the Data Provider, in the settings panel, click the dropdown under the Data label, and under Relationships, select either Current User.Table-Created By or Current User.Table-Updated By.

I've created a quick video below to help demonstrate how to do this in Budibase (including a bonus conditional UI tip).

 


 

Displaying relational data

You can also use a relationship data source to access data from any table relationship.

For example, you may be viewing the details of a manufacturer, but also want to see a list of their products on the same screen.

Data
One Manufacturer -> Many Products

Design

  1. Add a Table Block nested below the Repeater of the Autogenerated 'Manufacturer Detail' screen.
  1. Select the Products relationship column from the data source dropdown

Did this page help you?