I am trying to display a coupon based on a dataset, I have set the field identifying the coupon as Reference
pointing to the Market/Coupon dataset, however I am only able to get the UUID for the Coupon.
Dataset layout
show = Boolean
coupon = Reference(Marketing/Coupons)
Code
import wixData from 'wix-data';
$w.onReady(function () {
wixData.query("Web-Display-Coupon")
.eq("show", true)
.find()
.then( (results) => {
if(results.items.length == 1) {
let result = results.items[0];
$w("#couponTitle").show();
$w("#couponText").text = result.coupon;
$w("#couponText").show();
}
});
});
Any idea how to get the coupon name rather than the UUID as I do not appear to be able to query the “Coupons” dataset directly via wixData.query