web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform integration forum
Under review by Community Managers

Under review

Thank you for your post! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Embedding virtual (React) component in to Canvas App

Posted on by
Hi all!

I have written and deployed a React PCF component that retrieves all records from an entity in dataverse and then adds these records as options to a single select optionset field: 

 
The component works perfectly in a model driven app, but when I try to add this component to a Canvas App, I get the infamous Couldn't import components message that I've seen in quite a few threads on here now.
 


Initially I thought that this was due to the limitation that MS have put in place around use of the WebAPI in Canvas Apps so I removed all use of the Web API from my code and from the Control Manifest and just hardcoded the options in code.
I incremented the major version number of my control in the manifest and used pac pcf push to update the component but this did not resolve the issue.
 
I also changed the name of my component so that it created an entirely new component without the WebAPI and this produces the same error when trying to import in to a Canvas App.
 
Here is my control manifest:
 
<?xml version="1.0" encoding="utf-8" ?>
<manifest>
  <control namespace="MyCompany.MyClient.PCFComponent" constructor="CountryOptionset" version="1.0.0" display-name-key="CountryOptionset" description-key="CountryOptionset description" control-type="virtual" >
    <external-service-usage enabled="false">
    </external-service-usage>
    <property name="CountryLookupField" display-name-key="Country Lookup Field" description-key="Country Lookup Field" of-type="Lookup.Simple" usage="bound" required="true" />
    <resources>
      <code path="index.ts" order="1"/>
      <platform-library name="React" version="16.8.6" />
      <platform-library name="Fluent" version="8.29.0" />
    </resources>
  </control>
</manifest>
 
I've seen it mentioned that adding React controls to a Canvas App is in preview but I'm not sure how to enable or access this preview feature?
Any help you could offer would be greatly appreciated! 

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Power Platform integration

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans