Hi, I'm using the following code queen code to limit number of characters from a repeater field :
$w("#dataset1").onReady( () => { $w("#repeater1").onItemReady( ($item, itemData, index) => { let theItem = itemData.shortDescription; if (theItem.length > 80){ var shortyDescription = theItem.substr(0,80); $item("#text29").text = shortyDescription + " . . . ";}});} );
The problem I have is that my repeater is sourcing from two datasets which I linked (thanks to the filter option to match). And I'm trying to limit an item that is sourcing form that second dataset (#dataset2).
Do you know how can I select the $item from that second dataset?
Cheers !!
Hi there,
Have you tried loading the 2nd dataset and storing the repeater item's value in a variable from the same repeater? Perhaps you can try something like:
$w.onReady(function () { $w("#dataset1").onReady(() => { // your code $w("#dataset2").onReady(() => { $w("#repeater1").onItemReady(($item, itemData, index) => { //store the value of the repeater items linked to the 2nd dataset let repeaterItem = $item("#repeaterItem"); }) }); }); });
You can then store the repeaterItem value in a global variable to use it anywhere else in your code.
Hope this helps! Good luck!
Best regards,
Miguel