Using Subgrid Control In Model Driven Apps
Model-driven apps in Microsoft Power Platform offer a powerful way to manage data and create applications with rich business logic. One of the features that enhance user experience is the Subgrid Control. In this blog post, Matt Peterson, a trainer at Pragmatic Works, demonstrates how you can use the Subgrid control to view and manage related records directly within your app. This tutorial will show you how to implement this feature to simplify your workflows and improve data management.
What is Subgrid Control?
The Subgrid Control allows users to view and interact with records from related tables directly within a form in a model-driven app. This feature eliminates the need to navigate away from the parent record to access related data, improving the overall user experience. It is especially useful for applications where users need to manage large sets of related data efficiently.
The Benefits of Using Subgrid Control
- Streamlined Data Access: Subgrid allows related records to appear directly within the parent record's form, saving time and reducing unnecessary clicks.
- Improved User Experience: The Subgrid feature provides a cleaner, more intuitive interface for users, making it easier to manage related records without leaving the page.
- Quick Record Creation: Users can add new records related to the parent record directly within the Subgrid, eliminating the need to navigate to different parts of the application.
Steps to Implement Subgrid Control
- Set Up the Vehicle Table: Start by selecting the correct table in your solution. In this example, the focus is on the Vehicle Table, where maintenance records related to each vehicle are displayed.
- Go to the Form Section: Navigate to the form section of your Vehicle Table. This is where you will add the Subgrid control to display the related records.
- Add a New Tab: Create a new tab on the form. This tab will be used to hold the Subgrid control. Give it a descriptive name, such as "All Maintenance Records," to indicate its purpose.
- Insert the Subgrid Control: Within the new tab, add the Subgrid control. Choose the appropriate related table, in this case, the Vehicle Maintenance Table, and select the view that you want to display. In this example, the "Active View" is selected to show the active maintenance records for each vehicle.
- Publish the Changes: After configuring the Subgrid control, save and publish the form. This will allow the new Subgrid to appear in your application.
What Happens After Adding the Subgrid Control?
Once the Subgrid control is added and published, users can access related records directly from the parent record’s form. For example, when viewing a vehicle’s details, users can see all related maintenance records in a neat, embedded list. The Subgrid makes it easy to view the records associated with a specific vehicle without needing to navigate to different parts of the application.
Additionally, the Subgrid allows users to edit existing records. If a user wants to make a change to a vehicle maintenance record, they can click on the record within the Subgrid and modify it directly. Changes are saved automatically, and the updated records will be reflected immediately within the Subgrid.
Creating New Records from the Subgrid
Another benefit of using the Subgrid control is that users can add new records directly from within the Subgrid. For instance, if a user wants to add a new vehicle maintenance record, they can simply click the "Add New Vehicle Maintenance" button within the Subgrid. This will open a new form where the user can enter the details of the maintenance request, including vendor information, date, and cost.
Once the new record is saved, it will automatically appear within the Subgrid, making the process of adding related records quick and efficient.
Conclusion
The Subgrid control is a powerful feature in model-driven apps that simplifies the management of related records. By using Subgrid, you can provide users with a streamlined interface that allows them to view and interact with related data without navigating away from the parent record. Whether you're managing vehicle maintenance, customer orders, or any other related data, Subgrid provides an efficient way to improve your application’s functionality and user experience.
If you’re new to Subgrid or looking to enhance your app’s usability, adding this control is a simple yet impactful improvement. As demonstrated in this tutorial, it's easy to configure and brings numerous benefits to your application.
Sign-up now and get instant access
ABOUT THE AUTHOR
Matt Peterson is a Trainer for Pragmatic Works specializing in the Power Platform. He graduated from the University of North Florida in 2006 and comes with 15 years of teaching experience in high school algebra. Matt earned the accomplishment in 2013 of being named the Florida Gifted Teacher of The Year. His primary focus is helping our customers learn the ins and outs of Power Apps and Power BI.
Free Community Plan
On-demand learning
Most Recent
private training

Leave a comment