web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Dynamic Content #each loop

(0) ShareShare
ReportReport
Posted on by 286

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!

I have the same question (0)
  • Suggested answer
    Nya Profile Picture
    29,060 on at

    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.

  • ElineB Profile Picture
    286 on at

    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

  • Verified answer
    Nya Profile Picture
    29,060 on at

    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
    286 on at

    Thank you Nya!  

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 166 Super User 2026 Season 1

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 51 Most Valuable Professional

#2
NeerajPawar Profile Picture

NeerajPawar 51

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans