How can i filter my dropdown from relation?

Hello, I have three tables in db PRODUCT, BRAND and COLLECTION.
Relation is:
BRAND hasMany PRODUCT and BRAND hasMany COLLECTION
COLLECTION hasMany PRODUCT and COLLECTION belongsTo BRAND
PRODUCT belongsTo BRAND and PRODUCT belongsTo COLLECTION

When i add new product i choose barand and when i choose collection i nead to have dropdown list of all colection, where field brand_id = brand what i choose before.

  • Package Version: 0.0.1
  • Express Version: 4.17.1
  • Sequelize Version: 5.22.4
  • Database Dialect: mssql
  • Database Version: 15.0.2080

Hi @Kamil :wave:
To do what you want, you need to create a smart action by following this documentation https://docs.forestadmin.com/documentation/reference-guide/actions/create-and-manage-smart-actions.

When you have created the smart action, I suggest you to have a look on the dynamic form section, https://docs.forestadmin.com/documentation/reference-guide/actions/create-and-manage-smart-actions#making-a-form-dynamic,
to setup a change hook on your brand field to filter your collection field.

Let me know if that help.