Hi
I try to describe below a limitation if you know a workaround (posted this on a different topic as well)
We're using segment query to filter data
in the marketing email we have iteration as below:
<p>You have purchased:</p>
<ul>
<!-- {{#each contact.contact_product_productid}} -->
<li>{{this.name}}</li>
<!-- {{/each}} -->
</ul>
This displays ALL DATA regardless of segment query (which is a subset of records)
What is a solution as I mark this as big limitation on the personalisation as a D365 feature
kind regards
Thank you, you are right for this example.
But segment query block allows more advanced query than the personalisation email conditions that can be hardcoded in the html/javascript body
(example depth 2 on relationship query which is not a restriction for query block)
Kind regards,
slx
Hi slx wrote,
I got you. Yes, the personalization code displays ALL DATA regardless of segment query. (You would also get product types Y, Z)
But I think, this is a normal behavior. The segment query is only used to filter the contacts. It would not affect personalization code result.
So, what you need to do is to modify your code like this:
<p>You have purchased:</p>
<ul>
{{#each contact.contact_product_productid}}
{{#if (eq this.productType 'X')}}
<li>{{this.name}}</li>
{{/if}}
{{/each}}
</ul>
Thank you, trying to give more updates
scenario
- segment query to extract all contacts that have product type = X and many other conditions (as query builder is not limited to depth 2 relationships)
- the same contact can have different other product types Y, Z etc
Segment is created for contacts that fullfil the conditions which creates a sub-collection of contact records
When marketing email is created the code below will display all products associated with the contacts, not the actual results for the query (as the query cannot be replicated below):
<p>You have purchased:</p>
<ul>
<!-- {{#each contact.contact_product_productid}} -->
<li>{{this.name}}</li>
<!-- {{/each}} -->
</ul>
Hi slx,
The segment query is used to get the list of contacts who you want to send Marketing emails to. And the personalization code you provide would list the products contact purchased.
Only those contacts as a member of segment would receive this marketing email, other contacts would not. So, I am not clear what does “This displays ALL DATA regardless of segment query” mean.
André Arnaud de Cal...
292,160
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156