Skip to main content

Notifications

Announcements

No record found.

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

Condition statements in Real-Time marketing

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

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans