# Get content references inside a content item's Custom JS block

**URL:** <https://forum.builder.io/t/get-content-references-inside-a-content-items-custom-js-block/352>\
**Category:** Technical Questions\
**Tags:** visual-editor\
**Created:** [December 18, 2020, 9:41pm UTC](https://forum.builder.io/t/get-content-references-inside-a-content-items-custom-js-block/352 "2020-12-18T21:41:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex\_lindsay\_manime](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/alex_lindsay_manime/32/209_2.png) [@alex\_lindsay\_manime](https://forum.builder.io/u/alex_lindsay_manime)\
**Post date:** [December 18, 2020, 9:41pm UTC](https://forum.builder.io/t/get-content-references-inside-a-content-items-custom-js-block/352/1 "2020-12-18T21:41:47Z")

</div>

I had a very helpful answer to a post here: [Drag and Drop Data Binding](https://forum.builder.io/t/drag-and-drop-data-binding/347)

But…it leaves me trying to figure out how I can get data from an item which is a Reference in my selected content item. I have a Blog Post for which I have an Author as a reference. I also have a list of Blog Categories that I am trying to get detailed information about.

context.builderContent.data.author.fullname doesn’t work  
context.builderContent.data.author.data.fullname  
context.builderContent.data.author.data.author.fullname ?  
context.builderContent.data.author.value.author.fullname ?  
context.builderContent.data.author.data.author.value.fullname ?

I’d posted the following comment on that prior post asking the follow up question, but fear that since I marked the question as solved it won’t be seen as an update to the same question…

And…if I have a field which is a reference to an item in another content type? For instance I want to get the fullname of an author which is associated with a blog article? I see the author shows up an object: \_app.js:1 {@type: “@builder.io/core:Reference”, id: "06b3e264ec59403daedca3ec8db5} do I have to make a content API call to get the related data? It seems odd to have to make a content API call to include refs.

---

<div class="post-metadata">

**Author:** ![alex\_lindsay\_manime](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/alex_lindsay_manime/32/209_2.png) [@alex\_lindsay\_manime](https://forum.builder.io/u/alex_lindsay_manime)\
**Post date:** [December 30, 2020, 4:33am UTC](https://forum.builder.io/t/get-content-references-inside-a-content-items-custom-js-block/352/2 "2020-12-30T04:33:36Z")

</div>

I’ve had this come up in two different places now. I am also trying to create a page which is a blog index (fine) which also includes information for specific selected blog posts. I have created an input for box in which I have a list of references to blog articles. I’m repeating a box within that box based on the values in that list. I’m trying to look up the Title and lead image that are on the Blog Article type, but i only get Type, Id and Model as available to choose from. Do I need to make a separate query for the information for the referenced items? can I dereference them in Custom JS code?

---

<div class="post-metadata">

**Author:** ![aziz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/aziz/32/2551_2.png) [@aziz](https://forum.builder.io/u/aziz)\
**Post date:** [December 31, 2020, 2:15am UTC](https://forum.builder.io/t/get-content-references-inside-a-content-items-custom-js-block/352/3 "2020-12-31T02:15:44Z")

</div>

Thanks @alex_lindsay_manime for reporting, we found an issue where those values are not available while editing, and have a fix coming, should be included in the next release.

Users can opt in to including refs by sending an [`includeRefs`](https://www.builder.io/c/docs/query-api#__next:~:text=includeRefs,-No) param with the API request if you’re using the API directly or if in `react` you can pass it directly to the `BuilderComponent`

```auto
<BuilderComponent model="my-page-model" options={{ includeRefs: true }} .../>

```

And you should be able to see the references values on the context object while previewing (pressing preview current draft) or in production ( after publishing), and soon while editing once we deploy the fix.

---

<div class="post-metadata">

**Author:** ![alex\_lindsay\_manime](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/alex_lindsay_manime/32/209_2.png) [@alex\_lindsay\_manime](https://forum.builder.io/u/alex_lindsay_manime)\
**Post date:** [December 31, 2020, 5:47am UTC](https://forum.builder.io/t/get-content-references-inside-a-content-items-custom-js-block/352/4 "2020-12-31T05:47:42Z")

</div>

Thanks Aziz -

Yeah - I’m doing a separate fetch in the custom JS and adding includeRefs as a workaround.

Great to hear that there’s a fix coming.

---

<div class="post-metadata">

**Author:** ![radikris](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@radikris](https://forum.builder.io/u/radikris)\
**Post date:** [February 8, 2022, 4:40pm UTC](https://forum.builder.io/t/get-content-references-inside-a-content-items-custom-js-block/352/5 "2022-02-08T16:40:20Z")

</div>

Hi @alex_lindsay_manime !

Any update on this?

I need the same feature as you:

> [@How to bind a reference field to a symbol](https://forum.builder.io/t/how-to-bind-a-reference-field-to-a-symbol/636/3):
>
> What is the solution for it? I bound this hero reference to my component, but try to bind the property for it: Like this: But I got undefined as you can see. (If I bind model instead of reference, this state.binding works, but not with reference, how can I bind my Hero reference properties like title, subtitle for it, so I can choose my entry on the fly, when I add my symbol to the page)

Here is the thread with my question

I could bind my reference for it, and it has the id, and what should I do now to get my content model’s data, like title, subtitle, in your case, fullname, author etc

Thanks in advance!
