Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

Condition is not working in Each Loop in REAL Time Marketing

(0) ShareShare
ReportReport
Posted on by 216

Hello,

I'm trying to add condition in for each block in marketing emails but it's showing error. I wanted to show the orders related to contact where "Add to email" check on orders is "Yes".

   <td>{{#each marketingOrder}}
                            {{#if marketingOrder.$vw_addtoemai }}
                        <p style="color:;font-size: 14px; font-weight: normal;font-family: 'Open Sans', Arial, sans-serif;"><font face="'Open Sans', Arial, sans-serif">Order Placed:</font>&nbsp;</p>

                        <p style="color:;font-size: 14px; font-weight: normal;font-family: 'Open Sans', Arial, sans-serif; margin:1px 0 0;"><font face="'Open Sans', Arial, sans-serif">Order Number:</font> <font face="'Open Sans', Arial, sans-serif">{{marketingOrder.$vw_name}}</font></p>
                        {{/if}}
                        {{/each}}</td>
 
I'm using this code and on validation getting the below error
8765.Untitled.png
How to add condition in foreach loop in realtime markting ... please help
Best Regards,
Fariha Asmat
  • Fariha Asmat Profile Picture
    Fariha Asmat 216 on at
    RE: Condition is not working in Each Loop in REAL Time Marketing

    Hi Steve Zhao,

    Thanks for testing. Yes it's not working the both way I'll raise a ticket with MS on this.

    Thanks,

    Fariha

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Condition is not working in Each Loop in REAL Time Marketing

    Hi Fariha Asmat,

    I have tested multiple ways such as: 

    {{#each MarketingOrders}}

      {{#if this.cr287_addtoemail}}
      {{/if}}
    {{/each}}

    or 

    {{#each MarketingOrders}}

      {{#if MarketingOrders.cr287_addtoemail}}
      {{/if}}
    {{/each}}

    However, neither of them could work. It seems that condition could not work in list by now. You would better raise a ticket.

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,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans