HELP!! Syntax issues in HTML using Liquid Template Syntax functions | Community
Skip to main content
Level 4
April 4, 2025
Solved

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

  • April 4, 2025
  • 1 reply
  • 514 views

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. 

 

What am I missing here? Please help! 

 
Best answer by SatheeskannaK

@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/personalization/functions/helpers#each

1 reply

SatheeskannaK
Community Advisor
SatheeskannaKCommunity AdvisorAccepted solution
Community Advisor
April 4, 2025
Thanks, Sathees
Level 2
April 4, 2025

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