assigning value to text box in Repeater from the dataset

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 ;
});
});

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:

$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.

Thank, great help…
It’s working fine.