Help! I have an issue where I have to append a coupon to an email. My coupons are stored in a separate data set, and I initially was able to use this code to append a coupon:
{% let coupon = head(profile._********.walletInfo.couponDetails) %} {{coupon.couponId}}
However - I have duplicate ID's that now exist in this dataset and the head() function grabs the first instance (the old coupon). I've tried using this code:
{%#for coupon in profile._********.walletInfo.couponDetails %} {%#if coupon.campaignName == "Birthday_Coupon_2025" %} {{ coupon.couponId }} {% endif %} {%endfor %}
But I get the following validation error:
What am I missing here? Please help!
Solved! Go to Solution.
Views
Replies
Total Likes
@montezh2001 I haven't seen a for helper function in AJO instead try with the each/if function.
@montezh2001 I haven't seen a for helper function in AJO instead try with the each/if function.
@SatheeskannaK Thank you! After reading through this documentation and running a couple of test using Each/If coding, I was able to get it to work!
Thank you!