Hey!
This post is about marketing emails design, html and each loops.
I am trying to figure out how to retrieve a field from a lookup field.
Code below explained:
- Iterate through all memberships on a contact
- See if the membership is a main membership
- See if the statuscode is 1
- See if reason.code is not equal to 7 or 6
- If all of the if:s above, print enddate.
{{#each contact.membership_id}}
{{#if (this.main_membership_id.is_main_membership)}} //This is a lookup field on membership (1:N). I want to get the value of the bool is_main_membership.
{{#if (ne this.statuscode 1)}}
{{#if (ne this.reason_id.code 7)}} //Same as the first if statement. I want to reach the field on the lookup field.
{{#if (ne this.reason_id.code 6)}} //Same as the row above
End date: {{this.enddate}}
{{/if}}
{{/if}}
{{/if}}
{{/if}}
{{/each}}
Please help me understand if and how this is do-able!
Best regards,
Matilda