New XrmToolBox Tool – Power Apps Portal Dependencies!

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.

For many of these situations, an Advanced Find view can display the dependencies. But a single CDS objects can be referenced by multiple Portal configuration records at once, or by the same Portal configuration record in multiple ways, so a simple view may not suffice. For example, a CDS Entity can be bound to an Entity Form through both the Entity Name and Custom JavaScript fields. A CDS Attribute can be referenced from Liquid code in both a Web Template and Content Snippet record. Neither of these would be the easiest to show in a saved View. Even if you create some killer views, you need to open each individually to see the full scope of the dependency.

There’s a Tool for that

To make this a bit easier, I created a new XrmToolBox Tool! The Power Apps Portal Dependencies tool will allow you to select CDS components and view their dependencies in a single view.

Portal Dependencies Main Screen

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 CDS component and Portal Configuration Entity determine what CDS Attributes will be checked for each search. For example, for a CDS Entity searching against Entity Forms, the attributes Entity Form (adx_entityname) and Custom JavaScript (adx_registerstartupscript) will be searched for the selected Entity name and both could return a match.

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.

Search Results

All of the search result matching attributes will be displayed in this view. From the previous example, if the selected Entity Name matches both the Entity Name and is found in the body of the Custom JavaScript, both will be displayed. The matching search values are highlighted in the bottom pane for clarity.

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.

I also used some other more generic controls. The BoundListView control is used to display a list of CDS Entity Views and Forms and the list of Dependency Items, while the EntitiesCollectionDropDown displays a list of the available websites in your Portal Configuration. These controls require some external code, but they also handle most of the heavy lifting in terms of user interface elements.

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!


2 thoughts on “New XrmToolBox Tool – Power Apps Portal Dependencies!”

  1. Banyan McGowen says:

    I am having a difficult time making a connection with the Xrm toolbox to the PP Portal or CDS, can you share what method you used to do it? Thanks.

    1. Jim Novak says:

      Hi Banyan,

      What method are you using to connect using other tools? I have been successful using both the Wizard and the SDK Tool.

      If you have recently upgraded to the latest version, you may need to recreate your connections. This is a known issue with recent updates to the XrmToolBox application.

      Jim

Leave a Reply to Banyan McGowen Cancel reply

Your email address will not be published. Required fields are marked *