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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
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
I have the same question (0)
  • Fariha Asmat Profile Picture
    216 on at

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

    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

News and Announcements

Season of Giving Solutions is Here!

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
Pallavi Phade Profile Picture

Pallavi Phade 101

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 69 Super User 2025 Season 2

#3
TAHER Mehdi Profile Picture

TAHER Mehdi 58

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans