Skip to main content

Notifications

Announcements

No record found.

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

Condition is not working in Each Loop in REAL Time Marketing

Posted on by 212

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans