Show categories in form, that belongs to one user

Hello, I’m trying Adalo for a couple of weeks. I have 3 collections:

  1. Users (users can have multiple categories and multiple things)
  2. Category (category can have only one user and multiple things)
  3. Things (things can have only one user and only one category)

I created a screen with form for editing a thing with visible field “Category” and when i try it on preview mode - it shows me all categories in DB, instead of categories, that belongs to Logged in user.

I think, that Relationships in DB is all good. What am i doing wrong? Please help.

Hi @patrickis,

Welcome to the forums!

If I understand you correctly, in your “Edit Thing” form, you’d like to restrict category list to those belonging to a user?

If you’re using a built-in form, the behaviour you observe is expected; form for editing a Thing has no idea that thing’s category has to belong to a particular user.

You could achieve the result by building a custom form (assembling it from the components). You could use “Dropdown” component, make it a list of categories and filter it by categories which belong to logged-in user.

Also, one comment for the DB structure: why would you want to connect Thing to a User? Anyway this is already established in a Category. In your structure you could accidentaly have a result of a Category belonging to UserA, but a Thing in this category belonging to UserB.

Best regards, Victor.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.