Use code components in portals (preview)
[This article is pre-release documentation and is subject to change.]
Power Apps component framework empowers professional developers and app makers to create code components for model-driven and canvas apps (public preview). These code components can provide an enhanced experience for users working with data on forms, views, and dashboards. More information: Power Apps component framework overview
Power Apps portals now supports controls for model-driven apps created using Power Apps component framework. To use code components in portals webpages, follow these steps:
After following these steps, your users can now interact with the code component using the portal page that has the respective basic form.
- This is a preview feature.
- Preview features aren’t meant for production use and may have restricted functionality. These features are available before an official release so that customers can get early access and provide feedback.
- Portals only currently supports code components that are added to a field in a model-driven app.
- User must have a valid Power Apps license. More information: Power Apps component framework licensing
- System Administrator privileges are required to enable the Power Apps component feature in the environment.
- Your portal version must be 9.3.3.x or higher.
- Your starter portal package must be 9.2.2103.x or higher.
Create and package code component
To learn about creating and packaging code components created using Power Apps component framework, go to Create your first component.
Supported field types and formats
Portals supports restricted field types and formats for using code components. The following table lists all supported field data types and formats:
Floating Point Number
More information: Attributes list and descriptions
Unsupported code components in portals
Data-set components aren’t supported.
The following code component APIs aren’t supported:
The uses-feature element must not be set to true.
Value elements not supported by Power Apps component framework.
Add a code component to a field in a model-driven app
To learn about how to add a code component to a field in model-driven app, go to Add a code component to a field.
Code components for portals are available for web browsers using the client option of Web.
Configure portal for code component
After the code component is added to a field in a model-driven app, you can configure portals to use the code component in the basic form. Once you configure the code component on a basic form, ensure you configure table permission to allow portal users Read access to the Web Resource table before they can see the component on the portal page.
To add a code component to a basic form:
Open Portal Management app.
On the left pane, select Basic Forms.
Select the basic form to which you want to add the code component.
Select Basic Form Metadata.
Select New Basic Form Metadata.
Select Type as Attribute.
Select Attribute Logical Unit Name.
For Control Style, select Code Component.
Save and close the form.
Allow Read access to a Web Resource table
Portals requires Read permission to be set on the Web Resource table before users can see the code component on the webpage with the basic form.
To configure Read access on a Web Resource table:
Open Portal Management app.
On the left pane, select Table Permission.
Select Web Resource (webresource) for Table Name.
Select your website record.
Select Global for Scope.
In Privileges, select Read.
Under the Web Roles section, select Add Existing Web Role.
Select the web role for the users that should see the code component in portals.
For example, Anonymous Users for anonymous users, Authenticated Users for users authenticated by portals, or a custom web role.
Select Save & Close.
Once you add the basic form to a webpage, users assigned to the selected web role can now see the code component on the portal page having the selected basic form.