Stuck with queryReferenced

I am having problem with query referenced and think it may be my understanding!

I have a collection called ‘Fixture-Detail’ which has a multi-reference field to Blog Posts. I have a dynamic page associated with the ‘Fixture-Detail’ collection and with the velo code I have function as below that I want to get the details of the blog posts referenced within the field ‘fixtureRelatedPosts’ on the Fixture-Detail blog.

function filterPosts(id){

console.log(id) ;
wixData.queryReferenced("Blog/Posts", id, "fixtureRelatedPosts")
  .then((results) => {
    if(results.items.length > 0) {
      console.log(results.items[0]); //see item below
    } else {
      // handle case where no matching items found
	  console.log("No Results") ;
    }
  })
  .catch((err) => {
    console.log(err);
  });
}

From looking at queryReferenced - Velo API Reference - Wix.com - I feel as if I am doing exactly as per the example there however when running this code I get an error “Error: WDE0020: Provided property [fixtureRelatedPosts] is not a multi-reference field.” however from below you can see that it is

Am I doing anything completely wrong - as I say it feels as if what I want to do is exactly what is done in the queryreferenced example above!


This is how the reference parameters should be written - (collection ID, id of item, field id)

So in your instance it should be

wixData.queryReferenced("Fixture-Detail",id,"fixtureRelatedPosts")

Thanks - I spotted that after hours of looking at it :see_no_evil: Schoolboy error ftw!