Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Answered

Condition statements in Real-Time marketing

(0) ShareShare
ReportReport
Posted on by 47

Hello!

I'm trying to set up some conditional statements in Real Time marketing and the system gives me this error code:

Dynamic content contains a syntax error (such as a missing curly bracket) in or near the following code:

The conditional statements work fine if I input them into an Outbound Marketing template so there isn't anything wrong with the syntax, is there a difference between the two areas and the code they willa ccept? Or have I missed a setting somewhere? 

Thanks,

Charlotte

  • Suggested answer
    Vinayd-MSFT Profile Picture
    Vinayd-MSFT Microsoft Employee on at
    RE: Condition statements in Real-Time marketing

    You dont need to use coding in Real-time anymore - with "Conditional content" preview, you can easily create conditions without writing any code. As to your original question, the syntax in Real-time is different - if you still want to use code, go to Advanced Personalization property pane and then use "Condition" option to define a condition. You can then use "Save and generate code" to get the code you need.

  • Olasan Profile Picture
    Olasan 2 on at
    RE: Condition statements in Real-Time marketing

    Hi, have you tried the new feature in preview -> Conditional content. Maybe that will work better for you? Mind, it is in preview mode. docs.microsoft.com/.../conditional-content

  • Cdeyes89 Profile Picture
    Cdeyes89 47 on at
    RE: Condition statements in Real-Time marketing

    I actually went back and used the sample code provided by D365 in their training guides as I was using the same field to drive my code. (See below)

    {{#if (eq contact.address1_country 'Denmark')}}

       Hej

    {{else if (eq contact.address1_country 'US')}}

       Hi

    {{/if}} {{contact.firstname}}!

    Thanks!

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Condition statements in Real-Time marketing

    Hi Charlotte Starkey,

    Could you provide your conditional statements for further research?

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,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,817 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans