Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Filtering Lead View based on related contact segments

Posted on by 36
Hi!
 
We would like to filter a view for the lead entity based on the related contact (parent contact) that is a member of a certain segment. However, the resulting query is always 0. 
Anyone has an idea why that is?
 
 
 
  • Suggested answer
    Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Filtering Lead View based on related contact segments
    2.In Lead, only one result will be returned through two queries.

    --These leads will only be returned if the 'segmentmember' column of the parent contact is this segment:

    Very strange design, not sure why it is so, but it seems we just have to accept it.
  • Suggested answer
    Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Filtering Lead View based on related contact segments
    My test:
    1.In contact, these two queries will return different results:
     (1) contacts who 'segmentmember'' column is this segment will be returned.

     (2) only when the contact has been added as a member of a segment, they will be returned regardless of whether their 'segmentmember' column has a value.

  • Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Filtering Lead View based on related contact segments
    Hi Partner,
    As you said: So it seems like there is a difference between the normal Contacts and the Parent Contact for lead (Contact)???
    It's crazy that everything does work out as you say
  • Crownd Profile Picture
    Crownd 36 on at
    Filtering Lead View based on related contact segments
    Thanks again for taking the time and responding!
    However, I am still confused.
     
    So I checked again and the "Leads -> Parent Contact for lead (Contact)" is definetely correct and spills out a result if I query this. 
     
    On the contact entity, if I view the SegmentMember or Segment-ID column, I do not see any values whatsoever. However, what i really do find weird, is that if I filter  Contact -> SegmentMember[equals "Value_XX"] it works just as expected:
     
    So it seems like there is a difference between the normal Contacts and the Parent Contact for lead (Contact)???

     
  • Suggested answer
    Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Filtering Lead View based on related contact segments
    Hi Partner,
    You mentioned: everything seems to work perfectly fine: Contact -> SegmentMember[equals "Value_XX"]
    So the SegmentMember lookup field is not null in contact entity?
    If so,  it may be due to a problem with the chosen relationship between the contact and the leader.
    You selected 'Parent Contact for lead (Contact)'  when query records, so you need ensure that the 'Existing contact' field must be filled if you want to some leads will be returned.
    For example:
    I populated segmentmember onto one contact maually:
    And select this contact in the following lead:
    Filter leads:
     
    The following lead can be returned:
  • Crownd Profile Picture
    Crownd 36 on at
    Filtering Lead View based on related contact segments
    Thanks Leah!
     
     
    The thing is, i would like to create the View for the lead entity in the sales module and this somehow doesn't work.
    If I query with the same filtering scheme on the contact entity, everything seems to work perfectly fine: Contact -> SegmentMember[equals "Value_XX"]
    So i guess this would be the M:M relationship between Contacts and Segments
     
    Now if i just run the same query and add leads that are related to the contacts (like in the screenshot of my original post) it doesn't work anymore.
     
    so i would query Lead -> Parent Contact for lead (Contact) -> SegmentMember[equals "Value_XX"] 
     
  • Suggested answer
    Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Filtering Lead View based on related contact segments
    Hi Partner,
    By 'segment' do you mean segment in Marketing?
    If so, you can't filter records you want through 'Segmentid' or 'Segmentmember' lookup fields on the contact entity.
    Segments do not have a many to many relationship with Contacts.
    There is some kind of many to one relationships from Contact to Segment as there is some strange ‘Segment’ lookup field on the contact but that doesn’t many any sense because a Contact can belong to many many segments.
    You can check that both fields are empty, even if you have added the contact to a segment.
     
    That's why your result queries are always 0: to make irrelevant fields conditional.
    I hope you can verify my answer if it helps you! If you have any questions, please feel free to contact me.
    Regards,
    Leah

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,219 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans