How do you call the contents of a reference field in code?

Hi folks,
I have the following snippet of code that works just fine when “tag6” field is a TEXT field. However, when “tag6” is changed to a reference field, the code no longer works. When I copy and paste (from my database) the contents of a reference field into an Excel spreadsheet, it just pastes as “[object Object]” How do I access the text value of what is in the reference field so that the code below will work?

export function filterInput_change(event) {
$w(“#dataset1”).setFilter(wixData.filter()
.contains(“tag6”, $w(“#filterInput”).value));
}

Any thoughts?

Thanks!

Hi,
I recommend following the explanation of the article How to Use Reference Fields .

Good luck,
Tal.