# Connect single text object to dynamic data

**URL:** <https://forum.wixstudio.com/t/connect-single-text-object-to-dynamic-data/755>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [April 21, 2022, 8:05pm UTC](https://forum.wixstudio.com/t/connect-single-text-object-to-dynamic-data/755 "2022-04-21T20:05:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eugeniagarat](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/eugeniagarat/32/10225_2.png) [@eugeniagarat](https://forum.wixstudio.com/u/eugeniagarat)\
**Post date:** [April 21, 2022, 8:05pm UTC](https://forum.wixstudio.com/t/connect-single-text-object-to-dynamic-data/755/1 "2022-04-21T20:05:56Z")

</div>

Hi! I´m trying to connect a text object to a text field in a dataset item, but I don’t know how to code it myself and I only find repeaters examples.

This is my code:

```javascript
$item("#idioma").text = itemData.holaEs;

```

I understand something is missing enclosing it, something similar to this:

```javascript
$w("#repeater").onItemReady(($item,itemData,index)=>{ 
}

```

Otherwise item and itemData are red underlined, and when I hover them it says "Cannot find name ‘itemData’/ "Cannot find name ‘item’ ".

How should I modify the code in order to call those “terms” (item and itemData) for it to work with a single text object rather than with objects within a repeater?

I’m sorry for my lack of correct terms to express myself, I’m learning.

Thanks!  
Eugenia

---

<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:** [April 22, 2022, 5:11pm UTC](https://forum.wixstudio.com/t/connect-single-text-object-to-dynamic-data/755/2 "2022-04-22T17:11:32Z")

</div>

If you are simply trying to connect it to a dynamic page with a database element on it then you can use the code below -

```javascript
$w("#text").text = $w("#database").getCurrentItem().itemName

```

Here is the support link to help - [getCurrentItem - Velo API Reference - Wix.com](https://www.wix.com/velo/reference/wix-dataset/dataset/getcurrentitem)

If it is in a repeater you would have to connect the database to the repeater and then call the same code you posted above within the repeater on ready.

```javascript
$w("#repeater").onItemReady(($item,itemData,index)=>{
$item("#idioma").text = itemData.holaEs;
)}

```

---

<div class="post-metadata">

**Author:** ![eugeniagarat](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/eugeniagarat/32/10225_2.png) [@eugeniagarat](https://forum.wixstudio.com/u/eugeniagarat)\
**Post date:** [April 22, 2022, 5:48pm UTC](https://forum.wixstudio.com/t/connect-single-text-object-to-dynamic-data/755/3 "2022-04-22T17:48:16Z")

</div>

Thank you Jarod!
