web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / How to filter on looku...
Power Pages
Unanswered

How to filter on lookup column in FetchXML

(0) ShareShare
ReportReport
Posted on by 111

There are two tables, Customer and Order, in Order table there is a lookup column pointing to the Customer table.

 

If already knowing the customer id (assume it's 3), and want to search all orders belong to this customer, in SQL query we could do something like below without using Customer table:

SELECT order_date FROM Order WHERE customer_id = 3

 

What's the equivalent fetchxml to the above SQL query? Do I have to use the <link-entity></link-entity> to use Customer to achieve the same filtering result?

 

 

Categories:
I have the same question (0)
  • eugenevanstaden Profile Picture
    441 on at

    @jwnz 

    Like this below as the Customer field is on the Order table.

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
     <entity name="salesorder">
     <attribute name="name" />
     <attribute name="customerid" />
     <attribute name="statuscode" />
     <attribute name="totalamount" />
     <attribute name="salesorderid" />
     <order attribute="name" descending="false" />
     <filter type="and">
     <condition attribute="customerid" operator="eq" uitype="contact" value="{CD32B0AC-DC7F-EC11-8D21-00224810BB6F}" />
     </filter>
     </entity>
    </fetch>

     

  • jwnz Profile Picture
    111 on at

    Hi @eugenevanstaden thanks.

    In Power Pages, is there a place that I could export this xml?

    <condition attribute="customerid" operator="eq" uitype="contact" value="{CD32B0AC-DC7F-EC11-8D21-00224810BB6F}" />

    Is there any documentation about fetchxml, would like to learn the meaning of each element, like the above line of code, what could be in attribute, uitype, value?

  • Fubar Profile Picture
    8,491 Super User 2026 Season 1 on at

    In a Model Driven App you can use Advanced Find to create a query and then download FetchXML.  For more advanced queries people would generally use the FetchXML Builder plugin that is in XrmToolBox.

     

    https://learn.microsoft.com/en-us/power-apps/developer/data-platform/use-fetchxml-construct-query

  • jwnz Profile Picture
    111 on at

    @Fubar I assume Power Pages is not a Model Driven App, so wonder if Advanced Find is still available?

  • oliver.rodrigues Profile Picture
    9,471 Most Valuable Professional on at

    @jwnz Power Pages is not a model-driven app, however it has a model-driven app behind it, which is the Portal Management App

    From there you can export data, I believe Advanced Find is coming disabled by default now as this is being replaced by a more modern search engine: Modern advanced find with enhanced view management in model-driven apps | Microsoft Power Apps

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Valantis Profile Picture

Valantis 59

#2
11manish Profile Picture

11manish 51

#3
Haque Profile Picture

Haque 28

Last 30 days Overall leaderboard