How to Enable PCF Components for Older Canvas Apps
The Backstory
I wanted to try and embed a browser into one of my existing canvas apps but ran into a snag. I followed the instructions in the docs on enabling PCF components (https://docs.microsoft.com/en-us/powerapps/developer/component-framework/component-framework-for-canvas-apps) but I could only input Canvas based components, not PCF components because the "Import Components" "Code (experimental)" tab wasn't showing up even after I turned on the components preview option for the app:
I was able to eventually get the PCF Components to show up, but that required me to turn on every single preview/experimental feature of the app. I was concerned that maybe this was because my app was running on an old version of Canvas Apps, so I upgraded by App to the latest version of the app, and PCF components were still not showing up (Again, never had any problem with Canvas components showing up). I then proceeded to add every single experimental feature in the app settings, and again, the PCF components tab showed up, but when I imported the app into a new environment, the "Explicit Column Selection" feature broke the app. Turning off this feature removed my PCF control from the app, so I was in a no-win situation.
To test my theory that the issue was because my app had some legacy bloat which was causing it to fail, I created a brand new app, and the PCF components showed up exactly as expected. I then extracted my app using the CanvasApp Packager (https://github.com/daryllabar/CanvasAppPackager) and compared the differences in the extract json and found the fix!
Actual How To
To get get the PCF Controls experimental feature to show up in your older canvas app follow these steps:
- Export your app from the make.powerapps.com site to your machine.
- Unpack the app using the CanvasApp Packager (https://github.com/daryllabar/CanvasAppPackager).
- Open the Extract\Apps\<App Name>\Properties.json file.
- Search for the AppPReviewFlagsKey array.
- Add "nativecdsexperimental" to the end of the array e.g. "AppPreviewFlagsKey":["delayloadscreens","componentauthoring", "nativecdsexperimental"]
- Pack the app using the CanvasApp Packager.
- Import back into your make.powerapps.com environment.
- Enjoy being able to select your PCF components in your older Canvas App!
Published on:
Learn moreRelated posts
Power Apps – Create offline profiles in the maker studio for Canvas apps
We are announcing the ability to create offline profiles in the maker studio for Canvas apps in Power Apps. This feature will reach general av...
Power Apps – Manage your source code for canvas apps
We are announcing the ability to manage your source code for canvas apps in Power Apps. This feature will reach general availability on Septem...
Embedding Canvas Apps into Model-Driven Forms for a Unified Experience
In Microsoft Power Apps, there are two main application types—canvas apps and model-driven apps—each serving unique purposes. While model-driv...
Canvas App Error: “Row Size Exceeded” – Causes, Fixes, and Best Practices
When building Canvas Apps with Dataverse, you might see this error: The total size of the columns used in the database command exceeded t...
Dynamics 365 Field Service : Create task-specific canvas apps and custom pages
Field technicians are the backbone of any service-centric organization. But their success depends on having the right tools at their fingertip...
Automating UI Testing for Canvas Apps with Power Platform Test Engine
Canvas Apps in Power Platform provide a flexible way to build rich, custom user interfaces using a low-code approach. However, as these apps g...
User-Defined Function (UDF) in Power Apps Canvas App – EMI Calculator Example
In this blog you will know about User-Defined Function (UDF) in Power Apps Canvas App with a EMI Calculator Example Watch the video below or s...