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

Notifications

Announcements

No record found.

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 278

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
    278 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
    278 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 137 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 57

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans