# assigning value to text box in Repeater  from the dataset

**URL:** <https://forum.wixstudio.com/t/assigning-value-to-text-box-in-repeater-from-the-dataset/37425>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [August 12, 2022, 9:47am UTC](https://forum.wixstudio.com/t/assigning-value-to-text-box-in-repeater-from-the-dataset/37425 "2022-08-12T09:47:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbdocx](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/sbdocx/32/32162_2.png) [@sbdocx](https://forum.wixstudio.com/u/sbdocx)\
**Post date:** [August 12, 2022, 9:47am UTC](https://forum.wixstudio.com/t/assigning-value-to-text-box-in-repeater-from-the-dataset/37425/1 "2022-08-12T09:47:06Z")

</div>

Hi

Please do guide the correct way to do

$w . onReady ( function () {  
$w ( “#repeater1” ). forEachItem ( ( $item , itemData , index ) =\> {  
$item ( “#repeatertxtbox” ). text = $w ( ‘#dataset1’ ).field1. value ;  
});  
});

 ![](https://us1.discourse-cdn.com/wix/original/3X/8/6/868544bdf30a7a7ab2b67ee49ee65db9c4a601c6.png)

---

<div class="post-metadata">

**Author:** ![sentvinsent](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/sentvinsent/32/34229_2.png) [@sentvinsent](https://forum.wixstudio.com/u/sentvinsent)\
**Post date:** [August 12, 2022, 7:38pm UTC](https://forum.wixstudio.com/t/assigning-value-to-text-box-in-repeater-from-the-dataset/37425/2 "2022-08-12T19:38:10Z")

</div>

The easiest option is to connect repeater to data using settings (no need to connect specific elements). And then use the itemData to populate the desired value.

For example:

```javascript
$w("#repeater1").onItemReady( ($item, itemData, index) => {
$item("#repeatertxtbox").text = itemData.databaseFieldKey;
});

```

If the repeater is not connected to dataset it would be easier to get the data directly from the collection using Wix Data API. And the set the repeater data property to the gotten items.

---

<div class="post-metadata">

**Author:** ![for-samkukki](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/for-samkukki/32/32633_2.png) [@for-samkukki](https://forum.wixstudio.com/u/for-samkukki)\
**Post date:** [August 13, 2022, 8:33am UTC](https://forum.wixstudio.com/t/assigning-value-to-text-box-in-repeater-from-the-dataset/37425/3 "2022-08-13T08:33:40Z")

</div>

Thank, great help…  
It’s working fine.
