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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
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

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi Charlotte Starkey,

    Could you provide your conditional statements for further research?

  • Cdeyes89 Profile Picture
    47 on at

    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!

  • Olasan Profile Picture
    2 on at

    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

  • Suggested answer
    Vinayd-MSFT Profile Picture
    Microsoft Employee on at

    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.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 73 Super User 2026 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

#3
11manish Profile Picture

11manish 50

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans