Skip to main content

Notifications

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

Pull query based on two entities

Posted on by 163

I need to pull a query of all contacts with a Parent contact type and a role from the connections table of primary contact. Is there an easy way to pull queries like this in Dynamics? In SQL I could just write a query. Is there something similar in Dynamics?

  • Suggested answer
    Haig Liu Profile Picture
    Haig Liu Microsoft Employee on at
    RE: Pull query based on two entities

    Hi RyeTeacher,

    If you want to query the data using code, you can use the Web API:

    https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/query-data-web-api

    Unlike databases, Web APIs can also be used in conjunction with FetchXML, which is a proprietary query language.

  • Suggested answer
    Charan Raju C R Profile Picture
    Charan Raju C R 3,155 Super User 2024 Season 1 on at
    RE: Pull query based on two entities

    If I have understood your requirement correctly, you need to retrieve all the contacts where the relationship with other contacts via Connection Role is 'Parent'. If so, you can build a fetch xml query from advanced find as below -

    pastedimage1677949139721v1.png

    This fetch xml query can be downloaded and utilized in plug-in or reports based on your requirement.

  • Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: Pull query based on two entities

    Which Dynamics product do you mean?

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!

Community AMA December 12th

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans