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 / Pre-filter the out-of-...
Power Pages
Answered

Pre-filter the out-of-the-box list based on a query string

(1) ShareShare
ReportReport
Posted on by 96
Hello,
 
What I have:
I have an out-of-the-box list component (Audits). When the user clicks on a list item, they are taken to the (Audit) Details Page. This page has the id={Audit Guid} in the query string URL, and I'm showing some Audit data on this page.
 
What I want:
To add an out-of-the-box list component (Resources) to the Audit's details page. This list should be dynamically pre-filtered to include only items (Resources) that are related to the page's specific Audit (in other words, filter the list based on the page query string).
BTY, I don't want to use the Model Driven APP's related item subgrid as a form in this page, because I want the Resources list item to also be clickable and allow drilling down to a details page for a Resource. 
 
What am I missing?
I was hoping to use the FetchXML filter in the Metadata Filter section of the List component on the Power Pages Management app, but it seems that its purpose is a user-defined UI filter.
I also saw some examples of achieving this with FetchXML + Liquid, but from what I understand this approach involves rendering the list html by myself and not being able to leverage the out-of-the-box List component, with its immediate advantages like sorting and filtering. 
 
So, am I right to understand that there is no easy way of pre-filtering the out-of-the-box List component?
 
Thank you for your help!
Gil
 
P.S.
The same question also applies to the new modern Card Gallery, that I was hoping to be able to pre-filter dynamically.
Categories:
I have the same question (0)
  • Suggested answer
    sannavajjala87 Profile Picture
    174 Super User 2026 Season 1 on at
    Hey Gil, so youre not overlooking something big here. That metadata filter on the regular list setup is mostly for when users pick filters themselves through the interface, it does not automatically narrow things down just from having id equals some guid in the page url. At least not without extra setup to connect it to url parameters or something like that.

    I guess the simplest path keeps using the out of the box list, where you still get sorting and searching without hassle. Basically set up a list filter that pulls from a query string parameter. This way the list stays standard with paging and all that, but it can react to a url like with auditid equals a guid, or maybe even reuse the id parameter if that fits better.

    In the portal management or power pages app, first check that your resources table links back to the audit one, say with a field like crx auditid.
     
    Then make a dataverse view for resources, nothing special, just pick the columns and sort order you need.
     
    Open up the entity list for resources and add this filter thing, set it to lookup type, point it to that auditid field on resources, and name the query string parameter auditid, or id if you prefer sticking with what you have.
     
    Put the list on your audit details page, and make sure the url there passes the parameter. If its auditid, then the link ends up like slash audit details with id equals audit guid and auditid equals the same guid. Or if you go with id for the filter, just the single id parameter works fine.
     
    This whole pattern of filtering lists through url parameters comes up a lot in power pages stuff, it seems reliable enough.

    Now if you want the filtering to happen without any filter controls showing up, there are a couple ways people handle that. One is to add some css or js to hide the filter ui, so it runs in the background and feels automatic even though its still using the lookup and parameter setup.
  • Verified answer
    Fubar Profile Picture
    8,463 Super User 2026 Season 1 on at
    What is your relationship between Resources and Audit - is there a many-to-many or one-to-many relationship defined?
     
    If you do not have a relationship defined you would generally need to go for building it yourself. If there is a defined relationship then you should be able to use a Subgrid on the form (and using a metadata record of type subgrid on the form - you can define create/edit/view/delete as you do for a List)
     
  • shalem120kjh Profile Picture
    96 on at
    @sannavajjala87, thanks for taking the time to reply with such a detailed instruction! I really appreciate it.
    I followed the instructions (assuming that by "add this filter thing" you meant a lookup Metadata Filter). The result I ended up with was an unfiltered list, with lookup filter to the left of it, for the user to choose a value to filter by. The filter wasn't auto-populated with the record ID from the Query String (which was there), which is not surprising at all - since there is no mentioning anywhere in the documentation that the list component uses the Query String parameter to filter itself by (the Query String is mentioned only in another context, where you can define the Query String parameter that will be used on the Details page, once a list item is chosen).
    That is why I didn't continue to the "hide the filter with some JS" part, because I'm still stuck on trying to understand the mechanism of your suggestion. 
  • shalem120kjh Profile Picture
    96 on at
    @Fubar, thank you so much for your reply.
    There is a many (Resources) to one (Audit) relationship between those two entities. 
    I have to admit that, at first, I was disappointed from your suggestion, because I specifically mentioned that:
    BTY, I don't want to use the Model Driven APP's related item subgrid as a form in this page, because I want the Resources list item to also be clickable and allow drilling down to a details page for a Resource.
    But then I realized that I wasn't aware to the fact that I can configure row action buttons for the subgrid with form metadata! Adding this to the subgrid, which is already filtered for related items, makes it kind of equivalent to a regular list, which is a great workaround. 
     
    Thanks again!
    Gil.

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!

Leaderboard > Power Pages

#1
Suriyanarayanan V Profile Picture

Suriyanarayanan V 45

#2
oliver.rodrigues Profile Picture

oliver.rodrigues 14 Most Valuable Professional

#3
DP_Prabh Profile Picture

DP_Prabh 13

Last 30 days Overall leaderboard