Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Answered

Dynamic Content #each loop

(0) ShareShare
ReportReport
Posted on by 272

Hi,

I have an issue with some dynamic content and I hope anyone can help me out.

I use the following statement in an email, showing only text from a field on a lead when this lead matches specific criteria

{{#each contact.lead_contact_parentcontactid}}

{{#if (eq this.xx_xxlevelid 'aaaaaa-cccc-eeee-8f8e-00000000')}}

{{#if (ne this.xx_nurture 123456789)}}

Your interest is also in: 

{{this.aa_fieldname}}

{{/if}}

{{/if}}

{{/each}}

But when having more leads with matching that specific criteria it is also showing "Your interest is also in:" more than once. How can I obtain that this specific test is only showing once when leads find that match that criteria?

Thanks in advance!

  • ElineB Profile Picture
    ElineB 272 on at
    RE: Dynamic Content #each loop

    Thank you Nya!  

  • Verified answer
    Nya Profile Picture
    Nya 29,058 on at
    RE: Dynamic Content #each loop

    Hi Eline,

    It cannot be done unfortunately since you need to iterate over each lead, and there is no such judgement in this expression.

  • ElineB Profile Picture
    ElineB 272 on at
    RE: Dynamic Content #each loop

    Hi Nya,

    Yes that is a solution, but I only want to display the item when there is something to show. When there is no lead matching the criteria, the text should not be there.

    Best regards,

    Eline

  • Suggested answer
    Nya Profile Picture
    Nya 29,058 on at
    RE: Dynamic Content #each loop

    Hi Eline,

    Please try to move the "Your interest is also in:" out of the for each loop.

    It would be something like:

    Your interest is also in: 

    {{#each contact.lead_contact_parentcontactid}}

    ...

    So that it won't be repeatedly displayed.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,846 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans