Create a dynamic multi-table view as a data source

I’m new to Bubble and I still “think in SQL.” I have Bubbles data types with a parent-child relationship: The Parent table is a list of Events and the related Child table is a list of RSVPs to those Events. Every RSVP has the Event ID, a User ID, and a response (yes/no). I want to create views based on a join of these tables that I can use as a datasource for tables and charts. Example: a list of Events and total count of responses, or a pie chart that shows the events broken down by how popular they are (based on number of attendees). Is this possible in Bubble? Can you create a dynamic view that becomes a datasource for other page elements? If not, what is the Bubble best practice for handling this category of requirement? Thanks!

There is no view mode you can create in Bubble. There are some basic group by etc, and you can get the count. Even in that case, it is limited.

What you should do is a bunch of Do a search fors. For example, if you want to display the list of events and total count of responses, you will use a repeating group of type event, and data source of maybe all or some events. Then, in a cell, you will do another search for responses (if responses are not directly inside the event as a list) and get the count of them.

There is no business layer in Bubble, just database and Front end. That means you can’t get the data, do something with it and prepare it for frontend in a middle layer (or maybe I missed something very crucial).

The views you see in the app data tab of the editor are just for the app designer.

Also, you can treat the data types in Bubble as SQL, there is nothing wrong with that. But probably, in the long run, they will create problems. Bubble makes the connection (foreign key) automatically, when you create a field of another data type in a data type. So, I suggest if you will use Bubble, it is better you get used to Bubble way.

2 Likes