welcome to XRM blog

Keep in touch with latest CRM/ERP articles

To remain competitive your organisation must be efficient across the business process spectrum. To do so you need to take sound decisions based on a balance between the cost and risk. To do so you will be heavily dependent on your content management in itself needs...

image
Blog

Power Apps Grid control with custom filtering

By Syed Abdullah Azhar on 9/18/2025

When working with Dynamics 365 and Power Apps, one of the most common requirements is to show related records in a way that is both user-friendly and intuitive. Instead of making users click into multiple forms and tabs, you can leverage the Power Apps grid control to display related records, configure child relationships, and even apply dynamic filtering so users only see the records that matter. 

This article walks you through: 

1. Enabling the Power Apps grid control 

2. Configuring child records to appear on click of parent records (hierarchical expand/collapse) 

3. Filtering data in a grid based on records in another subgrid 

 What is the Power Apps Grid Control? 

The Power Apps grid control is a modern data grid that can replace traditional subgrids in Dynamics 365 forms. It offers features like: 

1. Hierarchical expand/collapse (to drill into child records) 

2. Infinite scrolling 

3. Inline editing 

4. Modern UI 

This makes it perfect for scenarios where users need to see parent-child relationships in one place. 

 Example Business Scenario 

Let’s assume we have the following entities: 

1. Group (parent entity) 

2. Recovery Strategies (related to Group) 

3. Deliverables (related to Group and Recovery Strategy) 

4. Tasks (related to Deliverables) 

The requirements are: 

  1. On a Group form, show all related Recovery Strategies in one subgrid.
  2. Show Deliverables in another subgrid, but only those that are connected to the Recovery Strategies listed above.
  3. Allow Deliverables to expand and display their child Tasks directly in the grid. 

 Configuring Related Records with Power Apps Grid Control 

Step 1: Enable the Grid Control 

1. Go to the form editor for your Group entity. 

2. Under Components section more components and select PowerApps grid control. 

A screenshot of a computer

AI-generated content may be incorrect. 

3. Configure PowerApps grid control properties like Child items, Views, Child items Parent Id etc. 

A screenshot of a computer

AI-generated content may be incorrect. 

4. Publish your form. 

This enables the new modern grid experience. 

Step 2: Configure Child Records (Expand/Collapse) 

The Power Apps grid supports hierarchical data. To enable this: 

1. Ensure your child entity (e.g., Tasks) has a relationship with the parent entity (Deliverables). 

2. In the subgrid setup for Deliverables, configure the Related Entity (Tasks). 

3. Once enabled, you’ll see an expand arrow next to each Deliverable in the grid. Clicking the arrow will show the child Tasks inline, without leaving the page. 

This creates a smooth hierarchy: 
Group → Deliverables → Tasks 

Step 3: Filtering Data Based on Parent Subgrid 

Out of the box, the grid will display all Deliverables linked to a Group. But in our case, we wanted to filter Deliverables so that only those tied to the Recovery Strategies listed in the Recovery Strategies subgrid appear. 

This requires custom JavaScript that triggers on form’s onLoad event filtering our Deliverables Grid

JavaScript Function: 

function filterDeliverablesSubgrid(executionContext) { 

    const formContext = executionContext.getFormContext(); 

    // Get Current Group Id 

    const groupId = formContext.data.entity.getId().replace('{', '').replace('}', '');  

    // Query Recovery Strategies related to the current Group 

    Xrm.WebApi.retrieveMultipleRecords("student_testrecoverystrategy", `?$select=student_testrecoverystrategyid&$filter=_student_group_value  

eq ${groupId}`).then( 

        function success(result) { 

            if (result.entities.length > 0) {

                let recoveryStrategyIds = result.entities.map(r => r["student_testrecoverystrategyid"]); 

                // Build FetchXML filter 

                  const fetchXml = ` 

                <filter type="or"> 

                    ${recoveryStrategyIds.map(id => `<condition attribute="student_recoverystrategy" operator="eq" value="${id}" />`).join("")} 

                </filter>`; 

              // Get Deliverables Grid Control 

                const subgrid = formContext.getControl("cc_1755165041152"); // Deliverables Grid Name 

                if (subgrid) { 

                    subgrid.setFilterXml(fetchXml); 

                    subgrid.refresh(); 

                } 

            } 

        }, 

        function (error) { 

            console.error("Error fetching Recovery Strategies: ", error.message); 

        } 

    ); 

Inline Editing in Power Apps Grid Control 

One of the standout features of modern grid control is inline editing. Users can update records directly in the grid without opening a form. 

Inline editing can be enabled by configuring the Grid Control Properties 

A screenshot of a computer

AI-generated content may be incorrect. 

1. Text fields, Option Sets, Dates, and Lookups can be edited inline. 

2. Changes are auto-saved when the user clicks out of the field. 

3. Reduces clicks and form navigation, making data entry significantly faster. 

How it Works: 

1. Fetch Recovery Strategies linked to the Group. 

2. Collect their IDs. 

3. Build a filter XML that only includes Deliverables tied to those Recovery Strategies. 

4. Apply the filter to the Deliverables subgrid dynamically. 

The Final User Experience 

Once implemented: 

1. Users open a Group record. 

2. The Recovery Strategies subgrid shows all linked strategies. 

3. The Deliverables subgrid automatically filters to show only Deliverables tied to those Recovery Strategies. 

4. Users can click the arrow next to a Deliverable and instantly view related Tasks inside the same grid. 

This gives a seamless parent → child → subchild browsing experience without leaving the Group form. 

A screenshot of a computer

AI-generated content may be incorrect. 

Final Thoughts and benefits 

1. Users save time by not opening multiple forms/tabs 

2. Only relevant data appears (filtered Deliverables) 

3. Expand/collapse makes navigation intuitive 

4. Combines out-of-the-box Power Apps grid capabilities with custom business logic 

Conclusion 

The Power Apps grid control is a powerful way to modernize record navigation inside Dynamics 365. By combining it with hierarchical relationships and JavaScript-based filtering, you can create highly efficient forms that display exactly the data your users need, when they need it. 

This approach is ideal for any scenario where parent-child records are central to your business process, and it makes Dynamics 365 much more user-friendly. 

#Dynamics365Customization
#ExpandCollapse
#ModelDrivenApps
#PowerAppsGridControl
#RelatedRecords
#SubgridFiltering
Blog Calendar
Blog Calendar List
2025 Sep  32  7
2025 Aug  25  4
2025 Jul  17  9
2025 Jun  23  6
2025 May  60  9
2025 Apr  35  6
2025 Mar  58  7
2025 Feb  41  6
2024 Nov  11  1
2024 Aug  8  1
2024 Apr  59  4
2024 Mar  174  4
2024 Feb  501  3
2024 Jan  34  7
2023 Dec  44  6
2023 Nov  662  5
2023 Oct  891  12
2023 Sep  2033  9
2023 Aug  622  6
2023 Jul  48  6
2023 Jun  26  4
2023 May  45  5
2023 Apr  88  5
2023 Mar  230  6
2023 Feb  179  5
2023 Jan  88  4
2022 Dec  97  7
2022 Nov  298  2
2022 Sep  13  1
2022 Aug  32  2
2022 Jun  11  2
2022 May  6  2
2022 Apr  12  2
2022 Mar  2  1
2022 Feb  2  1
2022 Jan  1  1
2021 Dec  4  1
2021 Nov  2  1
2021 Oct  2  1
2021 Sep  14  1
2021 Aug  49  5
2021 Jul  52  4
2021 Jun  1921  5
2021 May  43  3
2021 Apr  2270  3
2021 Mar  217  5
2021 Feb  2833  7
2021 Jan  4277  9
2020 Dec  608  7
2020 Sep  83  3
2020 Aug  793  3
2020 Jul  139  1
2020 Jun  104  3
2020 Apr  105  3
2020 Mar  19  2
2020 Feb  34  5
2020 Jan  48  7
2019 Dec  18  4
2019 Nov  42  1
2019 Jan  23  2
2018 Dec  147  4
2018 Nov  68  3
2018 Oct  18  3
2018 Sep  1299  11
2018 Aug  7  2
2018 Jun  21  1
2018 Jan  74  2
2017 Sep  590  5
2017 Aug  17  1
2017 Jul  17  2
2017 Jun  65  2
2017 May  21  1
2017 Apr  40  2
2017 Mar  144  4
2017 Feb  866  4
2016 Dec  213  3
2016 Nov  1103  8
2016 Oct  356  10
2016 Sep  831  6
2016 Aug  40  1
2016 Jun  1897  6
2016 May  117  3
2016 Jan  73  2
2015 Dec  769  6
2015 Nov  4  1
2015 Oct  13  1
2015 Sep  1475  6
2015 Aug  14  1
2015 Jul  129  2
2015 Jun  11  1
2015 May  20  1
2015 Apr  30  3
2015 Mar  80  3
2015 Jan  5350  4
2014 Dec  18  1
2014 Nov  2260  4
2014 Oct  69  1
2014 Sep  107  2
2014 Aug  5345  1
2014 Jul  49  2
2014 Apr  2604  12
2014 Mar  308  17
2014 Feb  223  6
2014 Jan  1510  16
2013 Dec  21  2
2013 Nov  695  2
2013 Oct  256  3
2013 Sep  13  1
2013 Aug  40  3
2013 Jul  214  1
2013 Apr  62  6
2013 Mar  2404  10
2013 Feb  131  3
2013 Jan  353  2
2012 Nov  63  2
2012 Oct  519  10
Tag Cloud
Interested in our services? Still not sure about project details? get a quote