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
Thank you very much Clofly for this thorough clarification!
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.
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.)
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}}
4.
Web order records
Result
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
André Arnaud de Cal...
292,074
Super User 2025 Season 1
Martin Dráb
230,900
Most Valuable Professional
nmaenpaa
101,156