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

Dynamic Email - How to show previously purchased products?

(0) ShareShare
ReportReport
Posted on by 50

Hi,

I have to objectives that I would appreciate some advice on how to achieve. 

1. Display previously purchased products in a Dynamic Marketing Email. 

Based on the Contact table we have a related table named Web Order. How can I proprely use the #each statements to showcase Web Orders related to a Contact within a Marketing Email? 

2. Display a Contact's related Web Orders with status = Abandoned Basket.

The second objective is that I would like to showcase Web Orders related to a Contact where the Web Order have a status = Abandoned Basket. Abandoned Basket is a column on the Web Order table. 

Thanks in advance!

Joakim

I have the same question (0)
  • Verified answer
    cloflyMao Profile Picture
    25,210 on at

    Hi Joakim,

    1. Sync Web Order entity with marketing insights service:

    https://docs.microsoft.com/en-us/dynamics365/marketing/mkt-settings-sync

    (Now "Advanced Settings" is renamed to "Settings" and its UI has changed, and Marketing data configuration is renamed to Dataset configuration.)

    2. Copy the automatically generated relationship expression to email content.

    pastedimage1613544905313v1.png

    3. The dynamic expression can be put as text content or put into code element, the for-each loop would be below if lookup field of web order is called Buyer and the status field is optionset type field and 100004 is value of Abandoned status.

    ('this' represents web order.)

    pastedimage1613545653607v7.png

    Your web orders:
    
    {{#each contact.new_weborder_contact_new_buyer}}
    
    {{this.new_name}}
    
    {{/each}}
    
    
    
    Your abandoned web orders:
    
    {{#each contact.new_weborder_contact_new_buyer}}
    
    {{#if (eq this.new_status 100004)}}
    
    {{this.new_name}}
    
    {{/if}}
    
    {{/each}}

    pastedimage1613545571792v6.png

    4.

    Web order records

    pastedimage1613545507311v4.png

    Result

    pastedimage1613545490042v3.png

    Note: Currently rendered records are sorted randomly.

    More details for how to use for-each loops can be found in this section:

    https://docs.microsoft.com/en-us/dynamics365/marketing/dynamic-email-content#for-each-loops

  • Joakim Gunstad Profile Picture
    50 on at

    Thank you very much Clofly for this thorough clarification!

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 131 Super User 2026 Season 1

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 46 Most Valuable Professional

#3
NeerajPawar Profile Picture

NeerajPawar 41

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans