|
| 1 | +--- |
| 2 | +title: PowerApps component framework for canvas apps | Microsoft Docs |
| 3 | +description: Create code components for canvas apps |
| 4 | +keywords: |
| 5 | +ms.author: nabuthuk |
| 6 | +author: Nkrb |
| 7 | +manager: kvivek |
| 8 | +ms.date: 08/31/2019 |
| 9 | +ms.service: "powerapps" |
| 10 | +ms.suite: "" |
| 11 | +ms.tgt_pltfrm: "" |
| 12 | +ms.topic: "article" |
| 13 | +ms.assetid: 5d100dc3-bd82-4b45-964c-d90eaebc0735 |
| 14 | +--- |
| 15 | + |
| 16 | +# PowerApps component framework for canvas apps |
| 17 | + |
| 18 | +> [!IMPORTANT] |
| 19 | +> This feature is still experimental and disabled by default. For more information, see [Experimental and preview features](../../maker/canvas-apps/working-with-experimental.md). |
| 20 | +
|
| 21 | +PowerApps component framework enables app makers to create code components to use in an app or across the apps. more information: [PowerApps component framework overview](overview.md) |
| 22 | + |
| 23 | +In this experimental preview, PowerApps component framework enables app makers to create code components, debug, import and add them to canvas apps using the PowerApps CLI tooling. Only certain APIs are supported in this experimental preview. It is recommened to check each individual API whether it supports canvas apps or not. |
| 24 | + |
| 25 | +> [!WARNING] |
| 26 | +> Code components contain code that may not be generated by Microsoft and can potentially access security tokens and data. When adding code components to an app, make sure that the custom component solutions are from trusted source. |
| 27 | +
|
| 28 | +## Prerequisites |
| 29 | + |
| 30 | +1. System Administrator privileges is required to enable PowerApps component feature in the environment. |
| 31 | + |
| 32 | +> [!IMPORTANT] |
| 33 | +> By default PowerApps component framework is enabled for model-driven apps. |
| 34 | +
|
| 35 | +## Enable PowerApps component framework feature |
| 36 | + |
| 37 | +To add code components to an app, you need to be enable the PowerApps component framework feature in each environment where they are to be used. To enable an environment to use code components inside its apps: |
| 38 | + |
| 39 | +1. Sign in to [PowerApps](https://powerapps.microsoft.com/en-us/). |
| 40 | + |
| 41 | +2. Click on the **Settings** icon and then select **Admin Center**. |
| 42 | + |
| 43 | +  |
| 44 | + |
| 45 | +3. Select the environment where you want to enable this feature and click on **...** and then select **Settings**. |
| 46 | + |
| 47 | +4. Under the **Products** tab, select **Features**. |
| 48 | + |
| 49 | +  |
| 50 | + |
| 51 | +5. From the list of available features, turn on the switch under the **PowerApps component framework for canvas apps**. |
| 52 | + |
| 53 | +6. Now, open the app where you want to add the code component and navigate to **File** > **App settings** and select **Advanced settings**. |
| 54 | + |
| 55 | +  |
| 56 | + |
| 57 | +7. Turn on the **Components** switch under the **Experimental feature** section. |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | +## Implementing code components |
| 62 | + |
| 63 | +After you enable the PowerApps component framework feature in your environment, you can start implementing the logic for code components. The [implement sample component](implementing-controls-using-typescript.md) topic demonstrates the step by step process to create code components right from implementing the custom logic, manifest file, debug process, and creating a solution zip file. |
| 64 | + |
| 65 | +> [!NOTE] |
| 66 | +> Implementing code components is same for both model-driven apps and canvas apps (experimental preview). The only difference is adding the code components. |
| 67 | +
|
| 68 | +## Add components to a canvas app |
| 69 | + |
| 70 | +To add code components to a canvas app: |
| 71 | + |
| 72 | +> [!NOTE] |
| 73 | +> To add code components to a field or an entity for model-driven apps, see [Add code components to model-driven apps](add-custom-controls-to-a-field-or-entity.md) |
| 74 | +
|
| 75 | +1. Navigate to PowerApps Studio. |
| 76 | +2. Create a new canvas app or edit an existing app that you want to add the custom component to. |
| 77 | + |
| 78 | + > [!IMPORTANT] |
| 79 | + > Make sure the code components solution zip file is already [imported](https://docs.microsoft.com/en-us/powerapps/maker/common-data-service/import-update-export-solutions) into Common Data Service before you go onto the next step. |
| 80 | +
|
| 81 | +3. Click on **Insert** > **Components** > **Import component**. |
| 82 | + |
| 83 | +  |
| 84 | + |
| 85 | +4. Select **Code (experimental)** tab and add a component from the list and click on **Import**. This adds the sample component in the **Components** menu. |
| 86 | + |
| 87 | +  |
| 88 | + |
| 89 | +5. Navigate to **Components** and select the component to add it to the app. |
| 90 | + |
| 91 | +  |
| 92 | + |
| 93 | +## Known limitations |
| 94 | + |
| 95 | +1. Only the field type of components are supported in the experimental preview and not the data set type components. |
| 96 | +2. Common Data Service dependent APIs including WebAPI along with few other APIs are not available for this experimental preview. For individual API availability for this experimental preview release, see [PowerApps component framework API reference](reference/index.md) |
| 97 | + |
| 98 | +## See also |
| 99 | + |
| 100 | +[PowerApps component framework overview](overview.md)<br/> |
| 101 | +[Implement sample component](implementing-controls-using-typescript.md) |
| 102 | + |
0 commit comments