I've been coding applications for many years in a form of Basic, however I am new to both Wix coding and Java Script.
I have two collections with a many-to-many relationship. A. is a Category collection (business sectors), B. is a Business collection (individual companies).
Collection A. has a multi-reference field called Business which includes all the Businesses associated with a given Category.
I wish to display all the businesses for a selected Category using the queryReferenced() statement:
let names = await wixData.queryReferenced("Category", $w("#Category").value, "Business");
“Category” = Collection Name
“#Category” =Selected Category
“Business” =Multi-reference field name
names =list of business names in the Business multi-reference field
Are the above parameters correct?
I am using a repeater field to display the businesses.
Can anyone show me what the code looks like to insert the ‘names’ variable into the page to display the businesses using the repeater field.
Thanks in advance.