The data provider component is one of the most important components in Budibase. It exposes data to any child components that expect data input.
For example, all components under the Data section can be provided data.
In addition, the following components can make use of data providers:
A data provider can make all Datasources available for consumption within your apps. This includes, but is not limited to:
Once you have added your data provider you need to select which datasource you want to use. Simply click on the Data dropdown.
Nested data provider
Whilst you can nest data providers, you may find there to be some performance issues.
In addition to controlling which datasource that should be available to your child components, data providers also allow you to sort, limit, paginate and filter the data that will ultimately be presented in your app screen.
To determine the sorting of the data rows provided, select a Sort Column and Sort Order.
In this instance, the Table component can override the default sorting set by the data provider, however with other components the sorting will be static.
You can also see that a limit of 10 has been set. This sets the maximum number of rows that can be presented per page.
Limits, sorting and pagination are done through server side queries where possible for performance, e.g. if the datasource was PostgreSQL, or the Internal Budibase DB. It is worth noting however, that Custom queries and REST queries data provider settings are handled client side. As a result, in these cases, sorting will apply on a per page basis only.
The type of sorting will be determined by the data type of the chosen column. For example text columns will be sorted alphabetically, whereas number columns will be sorted numerically.
With pagination checked, this can be used by not only tables, but all components that are linked to that data provider. For example, a paginated data provider for a chart component will cause the chart to re-render with the new data as each page is cycled through.
To add filters to a data provider, click Define filters.
This will bring up a drawer from which you can select match all or match any mode.
You can then select the column you wish to filter on, alongside the operator. Click Add filter to filter on additional columns.
Click here for more on filtering.
Similar to sorting, filtering will be performed server side for SQL datasource and the internal Budibase DB, however for custom queries the filtering will be client side. Thus when using custom queries, it is recommended that you provide any filters within the query.
If you want to build something a bit more custom than a table; maybe you want a list of cards, then you will need the Repeater component. Here's an example of a list of service logs:
Updated 12 months ago