The App Data section in the Data Tab shows the application database, i.e., the actual data that you or your users have entered. It also has a few key tools to help you manage your data. Note that the Live and Development versions of the app have different databases.
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).
It can be very useful sometime to run your application as a specific user. For instance, 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.
Clicking this button displays a popup that creates a new database view, which defines the fields that are seen on the right side of the screen. Constraints can be added to create a smaller list. By default, each type has a view that shows most fields with no constraints. The number of views is unlimited, and these views are shared between the Live and Development versions. It is recommended to use new views to build your own admin panel.
Clicking this button opens a popup where you define which field is best to describe a thing in the table. This determines the way the data is displayed and how the CSV files are generated. For example, a user may be represented by their email, an apartment, an address, etc. This is for display purposes only.
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.
Enter something into the input box, and the things in the current view that contain the entered text or unique ID are listed. Use this for a quick search of the app data.
Note: When searching in App Data, some common words called “stop words” will be ignored based on your application’s default language.
Clicking this button displays a popup where you create a new database entry. Choose the type of thing and enter information into the predefined fields. This is equivalent to using a 'Create a new thing' action in a workflow.
Note that the data editor currently does not allow modifying a list of things. If you need to modify such fields, building a data admin page in your app is a better option.
Clicking this button displays a popup where you upload a comma-separated CSV file of data. The type of data and relevant fields should be defined in the app before importing the file. This feature is available to users with a paid Bubble plan.
Select the type of data and file to upload. Map the columns from the file to the fields of the data type and then validate and upload the data. This feature was recently improved and is now in a Beta testing phase.
Important: The first row of your CSV file must be a header row containing the names of the fields for the data. Here's a sample file for reference.
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.
Select which type of data to upload. The type of data and relevant fields should be defined in the app before importing the file.
Commas are typically used to delimit entries, but different delimiters are possible. Tab or pipe delimiters are useful when working with text that includes commas. Choose the delimiter in the application creating the CSV file.
Select a CSV file to upload.
This very important step is where you map the columns of data to the fields in the application database.
Select a data type field in the dropdown menu for each column of data. These fields should be defined in the data type before the upload.
If the field you're matching the column with is a custom type, then specify which field of the subtype should be used to match the text entry. For example, let's say you're uploading a list of apartments, and one of the fields is an owner. If the owner is represented by a last name in the CSV file, choose 'Last name' as the composite field. The entries should exist in the database before you upload the file. If two entries in the Bubble application database match the same value, an error will be returned.
This is the delimiter to use when a field is a list of things. It should be different from the main delimiter. For example, if ';' is used as the delimiter, the data should be in this form: 12;54;32;67.
Note: When importing data for type list, optionally enclose the list in '[' and ']', and then separate the individual items with the delimiter. For example, "[kitchen; bedroom; bathroom]", or "kitchen; bedroom; bathroom".
Clicking this button does a quick analysis of the data to be uploaded, to make sure the first couple of rows are valid.
Clicking this button uploads the data. First, it uploads the file to our servers. Then, it processes the upload in the background using your server capacity. While this happens, you are free to close the webpage and come back. An email will be sent on completion, or if there is an error while uploading.
Note: Only one upload or modify can occur at a time for a given application.
You can bulk-modify data via a CSV upload. To do so, you should have a file with a column containing the unique ID of the things you want to modify, and enter the values that should be modified in subsequent columns.
This button generates a CSV file with the data of the current view. The file is exported to the Download folder of your browser. This file can be edited. Because the app owner performs this operation, no privacy rules apply, and all fields chosen in the current view are exported. This feature is available to users with a paid Bubble plan.
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.
Clicking this displays the Version dropdown menu to switch between the Development and Live versions of the app. Remember that each version has a separate database.