This view lets you see the different data types and the different fields that are defined in your application.
You can see the different types on the left and the fields on the right.
You can create a type with the new type box on the left. You can do the same thing with fields clicking on the button 'Create a new field'.
This view also lets you delete types and fields. Types and fields deletions aren't real deletions in Bubble (while for elements, actions, etc.) they are. The reason is the data is still stored in the database, and the application needs to have some information about the type. If you delete a type or a field, it will get hidden from the lists of types/fields you can pick from. Deleting are reversible, clicking on 'show deleted types' or 'show deleted fields' will reveal the deleted items, and a button restore will appear next to each entry.
The Data Type view also lets you define some default values for each field. This value will be used when a new thing of a given type is created. For instance, if you want to set up an initial score to 10, you can type 10 in the text box. Note that this only applies to things created after setting up a default value, and once you delete the default value, things will not use the default value.
The App Data tab is where you can have a view of the current data that is stored in your application's database, for the current version (development and live versions have different databases, see this chapter for more details).
Note that this view is generic, and will not be specific to your application structure. It is recommended to build your own admin panel as a specific page of your app, as you will be able to customize entirely how you see and modify data.
The App Data tab is structured around the concept of database views, that are listed on the left side of the screen. A database view is a combination of three things:
- The fields that are shown in the view (the columns in the table)
- A sorting order
- Some optional search constraints to filter out some entries
By default, Bubble adds a view for each data type that is defined in your application. They will show all entries (things) for each type, sorted by creation date.
When you click on the pen icon on the right of the list, you can modify the view. If it's a default view, a new view will be created and will be modified. You can then add/remove constraints. When a view is selected, the table will update and show things that meet the constraints (if any).
In addition to database views, you can use the Quick Search box to search all entries included in the current views that contain the text you type in the box. It can be a text or a unique ID.
As things in Bubble have fields, it is up to you to decide which field is best to describe a thing in the table. Once a primary field is selected, the thing will be represented by the thing's field's value. Ideally, you'll want to pick a field that uniquely represents a thing. For the user type, the email is a great choice, but for other types it depends on your data. As a last resort, the unique ID is always a safe choice as it is unique to the thing.
The App Data tab also lets you modify and create things. By clicking on the button 'New entry', you will be able to create a thing of a given type, by filling the different fields. If you click on the pen icon in the table, you'll see all the fields of the current thing, and will be able to change them and save the changes.
Note that the data editor currently does not allow modifying list of things. If you need to modify such fields, building a data admin page in your app is a better option.
It can be very useful sometime to run your application as a specific user, to debug issues. When the current view shows users, you will see a button 'run as' in the table, for each user. Clicking this button will open a new tab and you'll see how the app looks and functions as if you were this user.
Note that until you log out, you'll be using the app as this user, so make sure you do not make changes that should not be done.
Bubble lets you upload data from a CSV file. Clicking on the 'Upload' button will reveal a popup that lets you import a file. The type of thing should be defined already, with the relevant fields. You open the file you want to upload, and match the columns with the fields of the type you've chosen.
Data should be valid to be uploaded (a yes/no field should only have yes/no values). Bubble validates all data prior to any upload, if one row is failing, nothing will get created and uploaded to the database. Note that if you are uploading repeatedly large amounts of data, we recommend working with the Bubble API and use some scripts to create data, as it's a more scalable approach.
Clicking on the 'Export' button will enable you to get a CSV file of the current view. All items in the current view will be in the CSV file, each thing will be represented by the relevant primary field. At this stage, the CSV file generation is done on the client; if you are exporting a large amount of data, we recommend using the Bubble GET API to read your database content with a script.
The App Data tab also lets you run some workflows on all (or some) entries of a view. For instance, if for maintenance reasons you need to modify all users and mark them as 'paid', you will use a bulk operation. This feature leverages the Bubble POST API, that lets you run some workflows in the background. Please refer to the Bubble API chapter and the Bulk Operation section of the Maintaining an Application chapter for more information.
The App Data is also where you can copy your database from the development version to the live version of your app, and restore data to a previous point in time. These operations are explained in the Maintaining an Application chapter.
The Privacy section of the Data Tab is where you define security rules. These rules let you make sure that only the right users can see some data. This is covered in details in the next section.