Converting database with reference field to collection for filtering

I have a budget database (dbBudget) that includes:

  1. project name (projectName) - a reference to a projects table
  2. category (category)- a reference to a categories table
  3. budget (budget)- a number

I want to present a table with all data and filter according to the project name, but because of the use in references, the normal filter would not work.
$w(‘#dbBudget’).setFilter(wixData.filter().eq(‘projectName’, ‘Project 1’));

How to create a collection from the database that can be filtered?

Not sure if this is the best way, but you can make a new field to the database, only for filtering.

Maybe like this: “project”, “1”.

And filter from that.

I am not sure how this will help…
The reference fields are names (of projects and categories) already existing in other tables. The dbBudget table set budget for the projects in different categories.

So they are in different databases?

You could try to use this:

And add the datasets for each project, and then enable the dataset that matches with the right project.

If there are very many projects, this can’t be the best way :joy:

But this is all I know.