If you’ve worked with Power Apps Portals, you may have changed up a Common Data Service (CDS) object and broke your Portal. For example, you change the display name of the CDS Form to which an Portals Entity Form is bound and the Entity Form will no longer load on the Portal. That can be a bit frustrating, especially since you have no warning on the dependencies for that object.
There’s a Tool for that
You first select a Solution to narrow down the list of Entities. Once you select the Entity, you can then search for instances of that Entity or select from it’s child Forms, Views, and Attributes. With this release, you can only search for one Entity at a time, but you can search for multiple instances of the sub components. For example, you can select multiple Forms and search for references to each all at one time.
Each search consists of a series of queries against the Portal configuration Entity types that can reference the CDS object. The breakdown of the selected CDS component and Portal configuration Entity being searched:
Entity: Web Page, Web Form Step, Entity Form, Web Template, Entity List, Content Snippet
Form: Entity Form, Web Form Step
View: Entity View
Attribute: Entity Form, Content Snippet, Entity List, Web Form Step, Web Template
The results of the search are displayed and grouped by the matching Portal Configuration Entity. The details of the search results are displayed in the pane below the list when a row is selected.
A quick aside
One cool bit with building this XrmToolBox Tool is that I leveraged user controls from a shared GitHub repository managed by myself and Jonas Rapp called xrmtb.XrmToolBox.Controls. I used a few controls that mostly encapsulate functionality for a specific use case: the Solutions Dropdown to provide a list of Solutions, Entities Dropdown for the list of Entities filtered by Solution, and the Attributes ListView. These controls load and manage specific CDS object types with minimal external code.
It’s a lot of fun and very satisfying to be able to reuse code like this and offer fixes and refinements each time that I use them in a project. Using these controls also allows me to focus on the specifics of the dependency search and not how to render the related data.
Check out the repo at the link and let me know if you have any questions or suggestions. We plan on reworking a few things in the controls, so keep an eye out for those updates.
Some additional features…
By default, you will search against all available websites since the CDS objects can be referenced by more than one website. If you would like to search against only a selected website, you can choose from the list provided.
If you would like to open the search result record, you can choose the link, the toolbar button, or double click the selected row. To copy the record URL, right click on the selected row.
…and more to come!
In the next release, I’ll be refining the search and display a bit to ensure that I did not miss any options. More importantly, I will be adding the ability to find dependencies between Portal Configuration items. For example, I want to display all of the records that reference a given Web Template. This is going to be a bit more complex, but I hope it will prove useful for more complex Power Apps Portal websites!
In the meantime, all feedback is welcome – Let me know if I missed some search criteria or if there is a feature you would like to see!