If you have some existing data, the fastest way to get data into a Budibase table is to import it using a CSV.
Budibase will assume that your file is comma-separated and that the first row is a header row - i.e. it contains your column names.
To create a table with a CSV:
Click on “Budibase DB”
Click “Create new table”
Give your table a name
Click the “Upload” button, and choose your CSV file
Click “Create”
Budibase will read your file, and display the column names that will be created. By default, all columns will be of type “Text”. However, you may change the column type at this point.
CSV import does not support relationships.
Attached below is our “Vehicles.csv” file, if you’d like to use this to try out the import.
How to build a basic CRUD app, using Budibase internal tables
Budibase comes with its own pre-packaged database. Within Budibase, you can create tables and columns, set up relationships between tables, and manage the data contained in the tables.
This guide will show you how to create a simple CRUD application with Budibase DB. We will build a Vehicle Maintenance Log, consisting of
A Vehicles table.
A Service Log table, to record the service history of a vehicle
If you do not have CSV data to import, you can build the table yourself.
To create our “Service Log” table:
Click on “Budibase DB”.
Click “Create new table”.
Call your table “Service Log”, and Uncheck “Generate screens in design section” - we will add these manually.
Create the following columns
Description - Text.
Vehicle. A relationship to the Vehicles table (one Vehicle has Many Service Logs)
Service Date - Datetime.
Category - Options. Our options will be Brakes, Tyres, Engine and Transmission, each separated by a new line.
Mileage - a number.
Finally, create some rows in the Service Log table, so that we have data to test with.
When users log into our app, we want to present them with a list of recent Service Logs - i.e. a list of Service Logs, in descending order of “Service Date”.
To achieve this we:
Navigate to the home screen, under “Design”.
Remove any default component that are on the page.
Add a “Data Provider” component.
Give the data provider a name, so that we can easily identify it in our component tree (left panel).
Setup the data provider to connect to the “Service Log” table.
Set the “Sort Column” to “Service Date”
Add a table component, underneath the data provider
Next, we are going to add a “Create new” button to our Service Log. We want to enter the new details into a form - inside a modal.
First, we will create and configure a button.
Create the button, and position it on the screen using a container. We place the container above our Service Log table, place the button inside, and right-align it.
Click on your button, and choose “Define Actions”.
Add a “Navigate To” action, with the URL “/service-log/new/row”, and tick the box to “Open screen in modal”.
Next, we will create a new screen that allows us to create new “Service Log” rows.
Click the “+” button to create a new screen.
Select the template “Service Log - new”.
Set the URL to “/service-log/new/row”.
Click “Create”. This will bring you to your new screen.
Click on the “Save” button on your new screen, then “Define Actions”.
Remove the “Navigate to” action.
Add a new action for “Close Modal”.