Skip to main content

Power Apps makers fix your solution woes with smart XML Diffing

Headshot of article author Alfredo Cerritos

Have you ever baked a cake and it didn’t taste right? What if you could go back in time and see what was missing or what you added too much of? The same happens with software when you don’t quite get what you wanted and want to review the history of changes. Wouldn’t that be great to do with Power Apps components? You could review the history and tell what changes were made.

Well, now you can do that. We recently added Smart XML Diffing to Power Apps that can be a real time-saver for you and your development team. The tool is a quick gateway to review the changes between component solution layers.

Figure 1 Form changes between layers. It looks like something got removed.

What are components and solution layers? Your environment is composed of many components. Forms, Sitemaps, and model-driven apps to name a few. Solution layers are the blueprints of these components. Think of your Dataverse environment as being a cake where you can add or remove more features or flavors to your cake using solution layers. Like a cake, the more features you add, the more delicious it is. Hopefully, we can get you more comfortable with layers, and maybe you will construct a fantastic wedding cake.

Because solution layers are so important many errors or unexpected behavior can arise due to changes in layering. The tool aims to empower you and humbly help you understand why you may be seeing errors, a missing feature, or seeing unexpected functionality. Then use this insight to take steps to correct or customize your experience. We currently support three essential components.

  • Sitemap
  • Forms
  • Model-Driven App

How to get to the tool?

Figure 2 Smart XML Diff tool

  1. Go to your environment from the Power Apps portal (powerapps.com).
  2. Go to Solutions in the left navigation pane and select a solution.
  3. Select a supported component and from the ellipse, select the See solution layers option.
  4. Select any layer above number 1 and click the Compare with previous layer button.
  5. A Code Editor like VS Code will display.

Hot Keys

  • F3 – Search
  • F8- Previous
  • F9 – Next

Getting to Smart XML diff for Forms

Getting to form Smart XML diff is a little different but not hard to do.


Figure 3 Reviewing Forms XML

  1. Go to your environment from the Power Apps portal (powerapps.com).
  2. Go to Solutions in the left navigation pane and select a solution.
  3. Click the table that your form belongs to.
  4. Click the forms tab.
  5. For any form and from the ellipse, select the See solution layers option.
  6. Select any layer above number 1 and click the Compare with previous layer button.
  7. A Code Editor like VS Code will display.

Using the tool

Let’s go through some ways you can use the tool. Here is a brief description of the terms source and target. The source is the environment, where you have made customizations that you want to share with others using solution export. Then, import the solution into your target environment.

Figure 4 source to target.

Managing your solutions best practice

Components and their changes are defined in the solution XML. To better manage and keep track of your changes, we recommend a dedicated focused solution for complex components. For example, in our model-driven FAQ, we recommend that you create a dedicated solution for your AppModule changes. If you want to move to this model and have some doubts, use the Smart XML diffing tool to review your changes. The same process can be done for any Sitemap or Form. Having more focused solutions reduces the risk of causing unrelated components to break after an update.

Customization layer problems

You notice that a feature is missing, or it is disabled. This can be due to changes in your unmanaged active layer.

How to resolve it? The easiest thing to do is compare the unmanaged active layer against the previous layer. The unmanaged active layer is the top layer on the solutions layers page. On review, you decide that the layer is not needed and can be safely removed. Use the Remove unmanaged layer button on the solution layers page to remove the layer and resolve it.

Figure 5 Remove unmanaged layer button.

Handling component dependencies

You notice functionality not working or you can’t upgrade or uninstall. A possible reason can be that there are dependency differences between your target and source environment. What is a component dependency? When a parent component definition links to a child component. If the child component is missing in the target environment, the parent component won’t work.

How to resolve it? You need to determine what dependencies exist and then decide how to move forward. We have this guidance here “Cannot Uninstall Solution” error occurs in Dynamics 365 (microsoft.com). You can use the Smart XML Diff to look at the XML in your target and source environments to determine the differences and missing dependencies.

Imported managed layer is causing a problem

You just imported the latest changes as a managed solution, and changes are breaking your system. In this case, we can’t use the Remove unmanaged layer button.

How to resolve it? Review the latest changes with the previous layer to see the differences. Once you have pinpointed the problem, you have a couple of options. One, delete the newest solution in your environment and import a new solution with changes that don’t break the system. A second option is to add another solution layer on top of the latest import that fixes the issue. Here is some information on the solutionaction property for advanced customizers out there considering updating the customizations XML directly.

Future Improvements

For the Model-Driven App, we are rolling out a new format for you to review your changes. This information is a clearer representation than is seen in the customizations file located in the solution zip. It is the effective merged XML. This XML displays AppModule and AppModuleComponents.

As this change is rolling out, you may see the XML from the AppModuleXmlManaged property. This is the same text you see when opening the solution layer zip customizations.xml file.

What does effective merged XML mean?

It does not mean when two companies come together. It means that you see the bubbled-up structure of the previous layers with the current layer. In a sense, the XML you see in the left or right tool panels is the historical snapshot of the model-driven App at that time.

 

Most Importantly

Thank you! We still want to do more work here. We want to hear from you. Do you like Smart XML Diff and would you like to see more features like this? We are listening and working towards making the best customer tooling. Please leave us your valued feedback.