Displaying data
After adding a data provider and selecting a datasource, the next step is to add a component that allows you to display your data. In many cases you will use one of the following components:
In the below example, a single Data Provider can supply information to the Sales Bar Chart, as well as a Repeater that displays a Container with a Headline and Paragraph for every row the data provider returns.
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 related to 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.sales
.
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.
Data
One User -> Sales
Design
- Add a Data Provider and nest inside it a Bar Chart and Repeater as siblings.
- Set the Data Provider's source to the Relationship of Current User.sales
- In the Repeater, add a container with headlines or paragraphs to display information from the table.
This arrangement will show only sales made by the current user.
Using Multiple Data Providers
Data Providers can use other Data Providers as a source
Each time a Data Provider is set to fetch information from a table or query, it creates extra network traffic on screen-load. If you're re-using data in multiple components on your screen, consider using a Data Provider to fetch the table without filters, and then any subsequent Data Providers can fetch from that first Data Provider and filter as needed, cutting down on the amount of queries to your database.
Updated 22 days ago