Expand my Community achievements bar.

Never miss an update of the Adobe Journey Optimizer Community Lens! Subscribe now to get the latest updates, insights, and highlights delivered straight to your inbox every time a new edition drops.
SOLVED

HELP!! Syntax issues in HTML using Liquid Template Syntax functions

Avatar

Level 4

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:

Invalid syntax found: 'EOF', expected: '}}'. Error beginning at position: Line 387, Character 10079. 
 
This error points to the end of my HTML. montezh2001_0-1743773894055.png

 

What am I missing here? Please help! 

 
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@montezh2001 I haven't seen a for helper function in AJO instead try with the each/if function.

https://experienceleague.adobe.com/en/docs/journey-optimizer/using/content-management/personalizatio...

Thanks, Sathees

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

@montezh2001 I haven't seen a for helper function in AJO instead try with the each/if function.

https://experienceleague.adobe.com/en/docs/journey-optimizer/using/content-management/personalizatio...

Thanks, Sathees

Avatar

Level 2

@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! 

 
{{#each profile.********.walletInfo.couponDetails as |coupon|}} {%#if coupon.campaignName = "Birthday_Coupon_AprilMay2025"%} {{coupon.couponId}} {%else%} Failed Test {%/if%}{{/each}}

 

Thank you!