Filter collection by value from reference field

Hello,

I am trying to filter a dataset (orderDB) which contains a reference field named “invoiceFk”. I want to be able to filter orderDB by determining if the invoiceFk has been paid or not. I have read through different forums but they aren’t exact what I am looking for as I have multiple orders per invoice.

any thoughts?

Thanks,
Morgan

You can filter your dataset to begin with so that only paid invoices are only shown.
https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#setFilter

if it involved multiple datasets and not just the one then you can use these examples.
https://support.wix.com/en/article/working-with-multiple-item-reference-fields
https://support.wix.com/en/article/about-referencing-multiple-items-in-one-field
https://support.wix.com/en/article/displaying-content-from-multiple-database-collections-using-reference-fields-4034931
https://support.wix.com/en/article/referencing-multiple-items-in-one-database-field
https://support.wix.com/en/article/about-connecting-multiple-database-collections

If you are wanting to query referenced collections, then read here.
https://www.wix.com/corvid/reference/wix-data.html#queryReferenced