Power Apps Related Galleries Explained with SharePoint and Dataverse

1.Understanding Connected Galleries in Power Apps

Connected galleries allow one gallery to display related data based on the item selected in another gallery. This creates a master-detail interface where users can view parent records and instantly see their associated child records without navigating to another screen.

This approach is commonly used in business applications such as content scheduling, invoice management, project tracking, and expense management. For example, selecting an invoice can display all invoice items, or selecting an expense can show all related expense line items.

Power Apps supports connected galleries with both SharePoint and Dataverse. While SharePoint relies on Lookup columns to establish relationships, Dataverse provides built-in relational tables that simplify working with related records.

2.Setting Up Parent and Child Galleries

Creating connected galleries begins by adding both the parent and child data sources to your Power Apps application.

The parent gallery displays the main records, such as projects, invoices, or expenses, while the child gallery displays only the records related to the selected parent item.

To improve the user experience, it’s recommended to visually highlight the selected record in the parent gallery using the TemplateFill property. This makes it easier for users to identify which record is currently active.

Another useful enhancement is displaying a message when no related records exist. This can be achieved by showing a label whenever the filtered child gallery returns zero records, providing clear feedback instead of leaving the gallery empty.

3.Connecting Galleries with SharePoint and Dataverse

The method used to connect galleries depends on the underlying data source.

SharePoint Connected Galleries

In SharePoint, child lists are linked to parent lists using Lookup columns. The child gallery is typically filtered based on either the parent item’s Title or ID.

When filtering by a lookup value, it’s important to ensure that both values have matching data types. If a lookup returns text while the parent gallery provides a numeric ID, functions such as Text() or Value() can be used to resolve type mismatches and avoid filtering errors.

Dataverse Connected Galleries

Dataverse provides native table relationships, making connected galleries much simpler to implement. Instead of writing manual filter expressions, the related gallery can directly reference the relationship exposed by the selected record.

This approach reduces formula complexity, improves readability, and takes full advantage of Dataverse’s relational data model. It is especially useful for one-to-many scenarios such as Expenses and Expense Line Items, Projects and Tasks, or Orders and Order Details.

4. Working with Nested Galleries and Flexible Height Layouts

Connected galleries become even more powerful when you display related records inside the parent gallery itself. This is achieved by placing a child gallery within the template of the parent gallery, creating a clean master-detail interface without navigating between screens.

To build this layout, use a Flexible Height Gallery for the parent gallery and set its layout to Blank. The nested gallery can then display the related records for each parent item by referencing the relationship or filtered data.

To eliminate unnecessary scrollbars inside the nested gallery, dynamically adjust its Height property based on the number of related records. This allows the parent gallery to expand automatically and display all child records smoothly.

When using dynamic heights, reposition other controls such as separators, labels, or icons relative to the nested gallery’s height so the overall layout remains responsive and visually consistent.

5. Calculating Totals and Enhancing the User Experience

Connected galleries can also display summary information based on related records. A common example is calculating invoice totals, expense amounts, or project costs by aggregating values from the child records.

Using the Sum() function, you can calculate totals directly from the filtered child records or from Dataverse relationships. This enables users to view important business metrics without opening individual records.

Several UI improvements can further enhance the experience:

  • Highlight the selected parent record for better navigation.

  • Display SharePoint document thumbnails when working with document libraries.

  • Show quantity, currency symbols, or descriptive text to make values easier to understand.

  • Display a “No related items found” message whenever the child gallery contains no records.

These small enhancements make connected galleries more intuitive and improve the overall usability of the application.

6. Common Challenges and Best Practices

When building connected galleries, there are several important considerations to ensure reliable performance.

If lookup comparisons generate errors, verify that both values use the same data type. SharePoint lookups often require Text() or Value() conversions to prevent type mismatch warnings.

For large SharePoint lists, be aware of delegation limitations when filtering related records. Whenever possible, use delegation-friendly formulas and test your application with larger datasets.

When working with nested galleries, dynamically resize the child gallery instead of allowing internal scrolling. This creates a cleaner interface and provides a better user experience.

If your application uses Dataverse, take advantage of its built-in table relationships instead of writing manual filter formulas. Direct relationship references simplify development, improve readability, and provide a more scalable solution for displaying related data across business applications.

Leave a Reply

you are successfully subscribed!

There was an error while trying to send your request. Please try again.

autopowerai.com will use the information you provide on this form to be in touch with you and to provide updates and marketing.