Connect single text object to dynamic data

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:

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

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

$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

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 -

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

Here is the support link to help - getCurrentItem - Velo API Reference - Wix.com

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.

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

Thank you Jarod!