Data type relationships

I have a data type with users and user settings. (A bit of an aside, but the terminology is at odds with everything I know about dbs (which isn’t a lot). I hope I’m using the right terms!)

I have a 2nd data type that collects up a query, passes the query to ai, and will write the ai response to that same data type (table).

Every “thing” in the 2nd data type needs to associate with a single user in the 1st data type.

I’m not sure how to create that relationship. I saw an old thread, but it’s referencing a dead web page. My struggles with what seems like nonstandard terminology may be interfering with my ability to find answers.

Is this already present due to the Creator field? (Is this linking back to the User data type?)

Yes,In Bubble, the Creator field on any data thing automatically links back to the User who made it.

So, when a user submits a query and that new “thing” is created in your second data type, its Creator field will be that user. No extra setup needed for that specific link!

If you needed to link it to a different user than the one who created it, then yeah, you’d add a new field of type “User” to your second data type. But for what you described, Creator does the job.

if you need to find the user settings for that user, just do a search for user settings where created by = current user.

1 Like

That’s helpful.

So to reference an image that was uploaded by a User and is in:
Data type: Query
Data field: image

I don’t really see where I’m going.

I can select the Current User, but nothing that seems to be getting me to the other data type

If I start with “Current cell’s Query”, I can maybe get a bit further, but I’m not sure how it all ties back to the authenticated user (image 2).

if I try to test it in the data tab, I don’t seem to be able to get an image into the page

(table).