Skip to main content

Notifications

Announcements

No record found.

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

Use segment query condition in custom channel to query related entities

Posted on by 2
Hi,
 
I have created a segment and its query like below
 
PROFILE(contact, contact_1)
    .RELATE(account_contact_primarycontactid, account_1)
    .FILTER(contact_1.address1_stateorprovince == 'California' && account_1.address1_stateorprovince == 'Washington')
 
In my customer journey, I added a custom channel tile. When a custom channel activity record was created, it will trigger my plugin code. 
In plugin, I would like to use the conditions of the related entity in the segment query /account_1.address1_stateorprovince == 'Washington'/ to find those account records of contact. 
 
How can I achieve this?  My example is simple.  What if the query is getting complex and involve multiple related entities? 
Is there a way to retrieve the query as FetchXML or QueryExpression? 
 
Thanks.
 
ART
  • RudyZhang Profile Picture
    RudyZhang Microsoft Employee on at
    Use segment query condition in custom channel to query related entities
    Hi,
     
    We apologize that our team did not find another way to meet your needs.
     
    Since this is not an out-of-the-box feature, a third-party plugin may be required if it is to meet your needs.
     
    Additionally, if you think your need is an essential feature, I recommend you use the link below to propose your idea to the Dynamics 365 community.
    https://experience.dynamics.com/ideas/
     
    Best Regards,
    Rudy Zhang
  • Use segment query condition in custom channel to query related entities
    Hi Rudy,
     
    Thanks for your suggestion.
    However, manually create the query expression would not meet our requirements.
    We basically need to find ways to figure out what account records did the segment query retrieved.
    Any other possible way we can look at?
     
    Thanks
     
    ART
  • Suggested answer
    RudyZhang Profile Picture
    RudyZhang Microsoft Employee on at
    Use segment query condition in custom channel to query related entities
    Hi,
     
    Regarding your request to convert a segment query statement into a FetchXML or QueryExpression.
     
    According to our team's search this is not an OOTB feature, you need to use the FetchXML Builder and create the query manually. For more information about FetchXML Builder, please refer to the link below.
    https://fetchxmlbuilder.com/
     
    Our team's testing process is as follows
     
    Step1, we construct a segment query using the segment query statement you provided.

     
    Step2, based on the constructed segment query, use FetchXML Builder to construct the query.

    Step3, transform the FetchXML query statement into QueryExpression.

     
    In addition, the above steps are just a general step, the specific details of the query need to be designed according to your business.
     
     
    I hope my answer is helpful to you! If you have any other questions, please feel free to contact me.
     
    Best Regards,
    Rudy Zhang

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