Linking Data to Setup Relationships for Budgets

Hi, everyone!

I’m working on an app that would allow a user to create a budget sheet, which stores listed items to be funded on it. The users would be invited to the budget, and be able to allocate funds to items on the budget. All of the users start with an equal amount of money (so assume the budget is $10,000 and there are 5 users everyone starts with $2,000), and as they allocate money to items on the budget their remaining dollars are reduced.

Below is an image that shows the 4 data types.

What I am trying to figure out is if this configuration is correct to accomplish the following:

  • Allow a user to create a budget and assign other users as members (I believe the members data field being a list should accomplish this)
  • Allow the User Budget data type’s User Budget Field to inherit a split value from the parent Budget data type’s Total Budget field

Is this the proper way to use data in Bubble to create relationships? This is my first time building anything other than a tutorial app using Bubble and it’s been the hardest part of using it so far.

1 Like

Hello @GeorgeOnBubble welcome to the community!

Awesome app!

When I built my first apps I ran across a similar feeling. After many apps later, I came to the conclusion that setting up the dB is pretty much half of the job!

Not time wise …. rather how it will work.

One thing that helped me was to write user stories about the core functionality. Pretty much what you have done …just with a bit more detail and context.

Let me take a stab at this based on what you have kindly shared:

  • An admin user enters an admin portal page where he/she can see a table of budgets where each row has a button to invite a member into a budget
  • Once this button is pressed a popup opens where an email address and a name/last-name can be entered. A button called “send” once pressed will send an email invite to that email address with a link to a page where the invited user can sign up to the application
  • When the invitee reaches the sign up page where he/she can enter their info and email address to be signed into the app and taken to a budgets page. The sign up page will only show if the url link holds a value with a unique ID of the formal invitation created for the prospective member
  • The new member-user sees this budgets page with budgets on a table
  • A budget is composed of budget items that hold a maximum expenditure amount that when used decreases this value from the budget’s total value
  • User can click on any row which takes him/her to another page where he can see more details about the page
  • On the budget details page he/she can see basic info about the budget, as well as, a table with budget items
  • When a budget item is clicked a popup shows up with info about the item, as well as, an input to enter the money they have consumed and a button to register it. The app will register that the current user consumed this amount for this item. This process can happen for any of the items on this table.

… you get the idea

Data base model to make the above happen:

User

  • First (text)
  • Last (text)
  • Email (text)
  • Role (options set: admin, member)

Budget

  • Title (text)
  • Items (list of items)
  • Members (list of users)
  • Amount (number)

Item

  • Title (text)
  • Amount (number)
  • Budget (budget)
  • Consumption (consumption)

Consumption

  • Title (text)
  • Amount (number)
  • Budget (budget)
  • Member (user)

Invitation

  • Title (text)
  • First (text)
  • Last (text)
  • Email (text)

Hope the above makes some sense. Not sure I answered your question directly though.

Further below a couple of instructional videos on building dB models in Bubble (and the last one above dB model in general)

Best of luck with your project :grinning:

2 Likes

Hello @cmarchan,

Thank you for the response. Your summary of the process is spot on with what I have been trying to create so far.

I am a bit confused why the Consumption would be tied to the Item data type, but I believe what your intent was there is for it to be able to pull total users have allocated to the item if I am following.

On your point on user stories, I do have a Trello board where I am maintaining that information in more detail so I can build this in a public manner that contains the user stories I have created so far. You’re 100% right that they help with understanding core functionality and explaining details.

Also, in your model where a Role is assigned to a user would a user be able to have more than one role? For example, if they were they were a participant in one budget, but needed to create their own budget and run the process for another group of users would that be possible without requiring a new account?

I appreciate the videos, I will review those further. Thank you again for the warm welcome and feedback!

1 Like

@GeorgeOnBubble

  1. Please do not draw any logical conclusion about the consumption object. I meant it for illustrative purposes.
  2. The user object can have a field where a role is assigned to it to manage a user’s permissions in the application. Access a page, see or not a group, etc etc. Usual roles are admin, regular, premium. Or for a marketplace something like admin, seller, buyer. You get the point :+1:t2::grinning:
1 Like