Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

many to many relation

Posted on by 20

Hello,

i have a custom entity named "subscription". I created a new n:n relation named "new_new_subscription_contact".

Now i want to create an marketing email where i can display all subscriptions a contact has.

I have played around with 1:n relations :

{{#each contact.lead_contact_parentcontactid}}
     {{this.subject}}
{{/each}}

This example is working for me. 

I have no idea how to implement a for each loop with n:n relation.

Thanks for you help

Ulrich

  • Suggested answer
    Preeti Rana Profile Picture
    Preeti Rana on at
    RE: many to many relation

    Hi Novia,

    The product currently doesn't support N:N relationships in this scenario for emails. N:N relationship support was added only to Segmentation. Please direct any further queries to d365mktcomm@microsoft.com 

    Thanks,
    Preeti Rana 

  • Novia Consult Profile Picture
    Novia Consult 20 on at
    RE: many to many relation

    Hello Clofly,

    thank your for your help.

    Unfortunately the for each loop does not show any data.

    I have added three records but nothing shows up.

    Regards

    Ulrich

  • cloflyMao Profile Picture
    cloflyMao 25,198 on at
    RE: many to many relation

    Hi Novia,

    Can you find other relationships(1:N or N:N) in marketing email assist-edit besides N:1?

    I don't know why 1:N or N:N have been removed in assist-edit in my current version(9.1.0000.13225) even if I had configured sync setting for my custom entity.

    To enable a custom entity that has any relationship to contact entity in marketing email, please do follow steps:

    1. Configure sync setting for custom entity: 

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

    2. In previous edition, you shall see all available relationships for contact in assist-edit: 

    https://docs.microsoft.com/en-us/dynamics365/marketing/dynamic-email-content#use-assist-edit-to-place-a-dynamic-expression

    If you can't find the relationship you want, try to add it manually.

    3. I also created a Subscription entity(N:N to contact), and I can find the relationship name in segment query view:

    pastedimage1581681171371v1.png

    copy the relationship.

    4. In marketing email, add following for each loop expression 

      Your Subscription: {{#each contact.new_new_subscription_contact_new_subscription_contact}}
    • {{this.new_name}}
    • {{/each}}

    Then create a simple customer journey for test.

    Regards,

    Clofly

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans