Hi Everyone,
I’d like help with the following scenario:
I am trying to provide a company link (ex. Apple. com) to each item (ex. Airpods).
*If the URL exists, I would like the textbox that holds the URL to appear.
*If no URL exists, I’d like the URL textbox to hide.
In the content manager I have made the field type URL and the field key is “ownerLink” (field Name is OwnerLink). As you can see below some items have a link, and others do not.

This is what I have so far:
$w.onReady(function () {
$w('#listRepeater').onItemReady( () => {
let url= $w('#dynamicDataset').getCurrentItem().ownerLink;
if (url) {
$w('#text19').show()
} else {
$w('#text19').hide(); //text19 is the highlighted textboxes below
}
});
});
Using the code above, my issue is that it shows the textbox even when the URL does not exist. (second highlight)
Any help would be great. Thank you!
Try this way…
$w('#listRepeater').onItemReady(($item, itemData, index)=> {
if ($item.ownerLink) {$w('#text19').show('float')}
else {$w('#text19').hide('fade');}
});
Hey I just tried it and now both are gone.
If i leave the first line (underlined) it’s the same as before:
$w . onReady ( function u {[/u]
$w ( ‘#listRepeater’ ). onItemReady (( $item , itemData , index )=> {
if ( $item . ownerLink ) { $w ( ‘#text19’ ). show ( ‘float’ )}
else { $w ( ‘#text19’ ). hide ( ‘fade’ );}
});
@christineschindele
What about this one?
$w.onReady(()=>{
$w('#dynamicDataset').onReady(()=>{
$w('#listRepeater').onItemReady(($item, itemData, index) => {
let url=$item.ownerLink; console.log("URL = ", url)
if(url){$w('#text19').show('float')}
else{$w('#text19').hide('fade');}
});
});
});
@russian-dima same issue as before.
Loading the code for the Gifts (All) page. To debug this code, open bw29k.js in Developer Tools.
URL = undefined
URL = undefined
URL = undefined

@christineschindele
How is called your DATABASE(COLLECTION) ? ID?
Ok, i think i made some mistakes.
Since you want to show all your items inside repeater, your repeater should be connected to a —> NON-DYNAMIC-DATASET, because a —> DYNAMIC-DATASET always just shows the —> CURRENT-ITEM!
That means —> creating a new —> NON-DYNAMIC-DATASET and connecting to your REPEATER & the wished —> DATABASE.
++++++ some new CODE +++++
$w.onReady(()=>{
$w('#NONdynamicDataset').onReady(()=>{//this DATASET is a NON-DYNAMIC-DATASET connected to the wished DB...
$w('#listRepeater').onItemReady(($item, itemData, index) => {//REPEATER ---> CONNECTED with the NON-DYNAMIC-DATASET....
console.log("MyItemData: ", itemData)
let url=$item.ownerLink; console.log("URL = ", url)
if(url){$item('#text19').show('float')} //--> if "text19" is inside REPEATER then---> $item('#text19'), else $w('#text19')
else{$item('#text19').hide('fade');}
});
});
});