Power Apps component framework FAQs

This article provides information on frequently asked questions about Power Apps component framework.

Where can I find some good examples of code components?

We have published set of basic components which showcase usage of various component capabilities and APIs. Lots of great examples from the community are available on the Power Apps Community Forums.

How to use rich data types in code components such as Collections?

Currently, this feature is not supported. However, there is a JSON function in canvas-apps that allows app makers to stringify their data.

  1. Pass the collection into the JSON function.
  2. Pass the string representation of the collection data that is returned from the JSON function into one of the component's string properties.
  3. Use JSON.parse in the component code to convert it back into a JavaScript Object.

Can I call other components from within another component?

This is not currently supported.

Can I bundle font resources?

Currently, font resources (files with a .ttf file extension) are not supported by the framework.

Can I use img resource property in canvas apps?

Currently, img resources are not supported in canvas apps.

TabIndex support for components in canvas apps

Currently, code components do not support tabindex property in canvas apps. For model-driven apps the tab assignment is assigned automatically using tabIndex = 0, so elements are navigated in the order they appear.

Can I add commandbar, search to subgrids

To add commandbar, search to a subgrid for model-driven apps, you need to specify the cds-data-set-options.

Can I access form context like I can in model-driven apps event handlers?

Accessing form context directly in a control is not supported. Code components are expected to work across various products like model-driven apps, canvas apps, dashboards, and hence they cannot have dependency on the form context. A work around is to make the code component bound to a column and add an OnChange event handler to that column. The code component can update the column value, and the OnChange event handler can access the form context. Column not bound to a table could be used, or a column bound to a table with submitMode set to never can be used. We will add support for the custom events in future which can be used for communicating changes outside of a control without adding a column configuration.

Cannot add/remove properties from code component once it is imported

The optional properties can be added in the newer component version, but existing properties cannot be removed. As a workaround, you can make the properties optional and hidden. Additionally, code components cannot add required properties in the newer version, and you need to create a code component with a new name and reconfigure it in the target system.

Can I access Window object from the component?

Currently, accessing Window object from the control is not supported.