Skip to main content

Section 3: Start Working With Data - Get to know your database (Lesson 3.1)

Sofia Maconi avatar
Written by Sofia Maconi
Updated over 2 months ago

Transcript

Bubble AI has created me a projects page because this is a project management tracker, and on this page, I can see that we have a repeating group.

If I just focus on the left-hand side, we can see it is called Repeating Group Projects Grid, and within that, we have a container. Within the container, we have some text such as the project name, the project description, and some other project details such as the start date and the end date. Fantastic.

Let's now jump into the Data tab and have a look at the database configuration. So, I'm in the Data Types tab currently, and here I have Project selected. Bubble AI went ahead and created these specific fields. So we have a description field, which is text—fantastic. That makes sense because a user will update this project by typing into a multiline input or just a standard input, so we're collecting text.

Next, we have end_date, and that has been set to a date specifically, because when Bubble recognizes data with a date format, it gives us more formatting options. Let's have a look at an example.

So, if I click through to the Design tab, here I have the Parent Group's Project start_date. Okay, fantastic. Now, if I click on start_date and then I click on more, I have some other operators. Now, this works because Bubble AI set the start_date and the end_date to a date type field, so it gives us all of these options. It allows me to format this date exactly how I'd like, even with some custom formats.

Down here, we can choose a current user's time zone, or we can remain with a static choice such as UTC time. So, if I remove this formatting, and let's take a quick look on the front end, we can see the start date and end date here. And because it's a date format, Bubble is showing us the date: Jan 15th, 2025, 9:00 a.m.

Well, what if I wanted a different format, such as Monday, January 15th, 2025, with no time? Maybe time doesn't matter. Let's see how we would achieve this.

So, I'm going to click on start_date again to give us this more option. I'm going to click on :format as, and I'm going to look for one that I like. Here we've got Feb 17th, but this is closer to what I want—I want the actual day of the week included. So, I'm going to select this one here, and I'm going to do the same for the end_date—click on the more option, :format as, and select our own format type.

Let's have another look on the front end. And here we can see that this is closer to what I'd like, with Wednesday, January 15, 2025.

Now, because description is a text type field, if I click on the more option, you can see that we have other operators here to compare data or to change text to all uppercase, lowercase, we can trim the number of characters, we can extract information, find and replace certain words with other words, truncate, and so forth.

So, it's very, very important—going back to the data—that when we create a new field, we set the correct field type. And the basic types we've got: text, numbers—if we set it as a number, that gives us all sorts of mathematical operators, and we can do a full range of mathematics on numbers—dates, date ranges (for, say, an Airbnb-type app), and so forth.

Why don't we create a new field to track the percentage complete? Okay, so I'm going to create a new field. I'm going to call this progress. Now, I'm going to set this to a number. Okay, like I talked about—numbers give us some interesting formatting options.

I'm going to set Create, then in the App Data, I'm going to populate some progress. So for this one, I'm going to say 80% complete, basically. And for the next one, maybe 40% complete. And this one here, 20% complete.

So then, back on the design, I can, for instance, duplicate this Parent Group's Project description, change description to progress, then maybe I'll just type progress before it so I know exactly what I'm looking at, and I'm going to put in percent afterwards. So we've now got a combination of static mixed with dynamic information, and I'm going to change the label to progress.

Let's have a look. Okay, there—here we go: 80, 40, 20.

Now, before we finish this lesson, I just wanted to show you that if I do click on progress, we've got the more option, and here we have all of the operators available to us. We have greater than, greater than or equal to, less than. We have addition, subtraction, multiplication, division, and all of these other operators at your disposal.

So, when you're thinking about setting up your database and creating your fields, really have a think about: What type of data are you collecting? How would you like to then work with the data? And how would you like to display it so it's formatted in a particular format that's easy to read and understand for your users?

Did this answer your question?