Database Structure Assistance

Hello Fellow Bubble Developers! I am having an issue with structuring my data tables for my application. I have the following different data types: User, OEM/Direct Customer, and Machine. A user creates an account to access the application (User). Then creates a profile within the application, which can either be a OEM or Direct customer type. They are then directed to create various machine profiles.

Currently, every user is seeing other users machines when they do a look up. Also, I have several different conditionals written on various report icons to turn green, if certain conditions are met. When a new user access the page, all icons are already green, due to the application looking at the last machine profiled, and not the users machine.

How should I link the data types together, for users to only have access to customers and machines they created? Any assistance is greatly appreciated!

Hi, with the structure I would follow the types of things that are interesting for you, that it User, OEM and Direct Customers, and Machines. BTW, the fields under Machines are probably the same for OEMs and Direct cutomers? If so, they are related directly to Users type, not to Direct customers, as your diagram shows.

The security normally doesn’t affect the db structure.

Under Data | Privacy you can set the ‘security’ details. When you create new data role, you can specify the accessibility criteria which can relate to the user or the thing - here you can make a filter, for instance you can filter things on the basis of their creator (“is Current User”), or you invent some other fields for that purpose which you fill out with the workflow when users enter these details.