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,...
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)
  • Joakim Gunstad Profile Picture
    50 on at

    Thank you very much Clofly for this thorough clarification!

  • 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

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