knowledgecenter-breadcrum

Knowledge Center

13 Feb, 2025

Filter List Using FetchXML in Power Pages

Posted on 13 Feb, 2025 by Rohit Bhagat, Posted in PowerApps Portal Power Platform Power Pages

Blogs

Introduction

Power Pages provide a flexible way to display data using lists, but sometimes, you may need more advanced filtering than what is available in standard configuration. FetchXML is a powerful tool that allows you to filter records dynamically. In this blog, we will explore how to filter lists using FetchXML in Power Pages.

In this blog, we will explore how to use both simple FetchXML and complex FetchXML with Link-Entity.

Use Case 1: Filtering Students by Status
Users can filter students based on their status (Active or Inactive) to view only the relevant records.

Steps to Follow:

  1. Navigate to the Power Pages Management Model-Driven App.
  2. Go to Lists (Entity List) and open the list where you want to add a filter.
  3. Under the Metadata Filter section, check the Enabled checkbox.
  4. Select the Orientation of Filters (Horizontal or Vertical) to determine how they will appear on the site.
  5. Click on +FetchXML Filter.



 

        6. Add your FetchXML condition as shown below

    <filter type="and" adx:uiname = "Status">
      <condition attribute="statecode" operator="eq" value="0" uiname = "Active" /> 
      <condition attribute="statecode" operator="eq" value="1" uiname = "Inactive" /> 
    </filter>

After adding the filter, save your list.

Don’t forget to sync your Power Pages site to view the latest changes.

After adding the filter, it will appear as shown below on the site.

 

Advanced Link-Entity Filtering
Filtering data from related tables helps refine search results more effectively. In FetchXML, the Link-Entity feature allows filtering records based on fields from other related tables.

Use Case 2: Filtering Students by Course 

In this example, the Student table and Course table are used with Link-Entity in FetchXML to filter students based on their status (Active or Inactive) and course selection.

Student and Course table has N:N relationship

How the Filtering Works:

  • Active Student + Course Selected → Displays only active students enrolled in the selected course.
  • Inactive Student + Course Selected → Displays only inactive students enrolled in the selected course.
  • Both Active & Inactive Selected → Displays all students enrolled in the selected course.

After selecting the desired filters, click "Apply" to update the list and view the filtered results.

This approach makes it easier to retrieve relevant student data based on course enrollment and status

<link-entity name="nisl_course_nisl_student" intersect="true" visible="false" from="nisl_studentid" to="nisl_studentid">
         <link-entity name="nisl_course" alias="aa" from="nisl_courseid" to="nisl_courseid" adx:uiname = "Course">
               <filter type="and">
                    <condition attribute="nisl_coursename" operator="eq" value="Art"/>
                   <condition attribute="nisl_coursename" operator="eq" value="Maths"/>
                 </filter>
         </link-entity>
 </link-entity>

After adding the filter, it will appear as shown below on the site.


Below points will be useful when adding a FetchXML filter:

  1. adx:uiname
    Definition: The adx:uiname attribute defines the unique name of a user interface element (e.g., text box, button), allowing it to be easily referenced within the system.





      2. adx:uiinputtype="dynamic"
        Definition: When set to "dynamic", the adx:uiinputtype makes the input type change dynamically based on conditions, user actions, or system context.

          3. adx:uiinputtype

          Definition: The adx:uiinputtype attribute specifies the type of input for a UI element, such as text, number, or date, to enhance and guide user interaction.


 

Comment

This is a Required Field

Loading

Recent Updates

Blogs
20 Jan, 2026

How to Add Dataverse as a Data Source in Power Apps Code Apps

In my previous blog, I explained what Power Apps Code Apps are and how we can build apps using React…

READ MORE
Blogs
12 Jan, 2026

Why Power Apps Component Framework (PCF) Is Becoming a Game-Changer in Power Apps Development

Introduction Power Apps is one of the most widely used platforms for building business applications. As organizations grow, they expect…

READ MORE
Blogs
01 Dec, 2025

Dynamics 365: Why One User Could Edit a Field and Another Couldn’t

Recently, we faced an issue in Dynamics 365 where the field was locked for one user but editable for another. The field…

READ MORE