After reading the docs twice and also seeing all the other people on this forum asking similar, but still different question regarding using query references, I’m still stuck and would like to call for a little help.
I’m am able to query my collection song2 that includes a reference to table artist by the field song_artist_id
By using include and the dataPath below, I can successfully display the artist_name field of that referenced collection in my resultstable.
$w( “#resultsTable” ).columns = [
{
“id” : “colartiest” ,
“dataPath”: “song_artist_id.artist_name”,
“label” : “Artiest” , // The column header
“type” : “string” , // Data type for the column
// Path for the column if it contains a link
“linkPath” : “link-field-or-property”
},
But when I try to query on that same field name in the contains function, it yields no results:
wixData.query( “song2” )
.include( “song_artist_id” , “song_song_type_id” , “song_album_id” , “song_style_id” )
.contains( “song_artist_id.artist_name” , $w( “#songinput” ).value)
.find() // Run the query
.then(songresult => {
$w( “#resultsTable” ).rows = songresult.items;
}
);
How do I query this field from a referenced collection in the contains function?
What am I missing here?
Thanks in advance for any help!