# Stuck with queryReferenced

**URL:** <https://forum.wixstudio.com/t/stuck-with-queryreferenced/8601>\
**Category:** Ask the community\
**Tags:** code, question, wix-blog\
**Created:** [June 20, 2023, 9:05pm UTC](https://forum.wixstudio.com/t/stuck-with-queryreferenced/8601 "2023-06-20T21:05:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![smcinnes1706](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/smcinnes1706/32/37745_2.png) [@smcinnes1706](https://forum.wixstudio.com/u/smcinnes1706)\
**Post date:** [June 20, 2023, 9:05pm UTC](https://forum.wixstudio.com/t/stuck-with-queryreferenced/8601/1 "2023-06-20T21:05:33Z")

</div>

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.

```javascript
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](http://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

![](https://us1.discourse-cdn.com/wix/original/3X/2/f/2fe2d6ee9cd0f0b162f6bbff60f5a33c638c40f1.png)

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!

```javascript

```

---

<div class="post-metadata">

**Author:** ![reswebdev](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/reswebdev/32/31109_2.png) [@reswebdev](https://forum.wixstudio.com/u/reswebdev)\
**Post date:** [June 22, 2023, 3:19pm UTC](https://forum.wixstudio.com/t/stuck-with-queryreferenced/8601/2 "2023-06-22T15:19:32Z")

</div>

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

So in your instance it should be

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

```

---

<div class="post-metadata">

**Author:** ![smcinnes1706](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/smcinnes1706/32/37745_2.png) [@smcinnes1706](https://forum.wixstudio.com/u/smcinnes1706)\
**Post date:** [June 22, 2023, 4:51pm UTC](https://forum.wixstudio.com/t/stuck-with-queryreferenced/8601/3 "2023-06-22T16:51:12Z")

</div>

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