PL400 : Design Power Apps reusable components

Reusability is the core concept of any software application, as it allows performance optimization and reduces complexity and Power Platform in particular Power Apps is no exception. Reusability aims to save time and resources and reduce redundancy by taking advantage of already created components in some form within the Application  development process.


Build once and reuse multiple times.

While, canvas Apps provide control on each screen, it has the amazing feature of being a reusable component on the same.

What is Components ?

Components are the reusable building blocks for canvas apps. We can define a set of controls to be used inside an app.

Components are useful in building large apps with similar control patterns. If you update a component definition inside the app, all instances of the app reflect your changes. Components also reduce duplication of efforts by eliminating the need to copy/paste controls and improve performance. Components help create collaborative development and standardize the look and feel across the organization when you use a component library.


Components feature is not default feature, it needs to enable in the App Setting.


Think of a component as an encapsulated black box with properties as an interface. You cannot access controls in the component from outside the component. And you can't refer to anything outside the component from inside the component. Exceptions are data sources shared between an app and its components. Scope restrictions keep a component's data contract simple and cohesive, and this helps enable component-definition updates, especially in apps with component libraries. You can update a component's data contract by creating one or more custom properties.

Custom Properties:

A Component can get the input values as well expose the data, if we create one or more custom properties.

Input property is how a component receives data to be used in the component. 

Output property is used to exposed data or component state. 


The Export components and Import components operation are deprecated. Component libraries are now the recommended way to reuse components across apps.

Component Libraries :

A component library provides a centralized and managed repository of components for reusability and it is like containers of component definition that make it easy to :

  • Discover and search components.
  • Publish updates.
  • Notify app makers of available component updates.

Known limitations

  • We can't save data sources, forms, and data tables with components.
  • Collections in components are not supported.
  • We can't insert a component into a gallery or a form.
  • A master instance of a component is a local master and scoped to the app. If we change a master instance, only copies of the component within the app will reflect the change. Copies in other apps will remain the same unless we import the component library again. All master instances in those apps will be automatically detected and updated.
  • We can't package media files when you import a component.
  • Components don't support the UpdateContext function, but we can create and update variables in a component by using the Set function. The scope of these variables is limited to the component, but you can access them from outside the component through custom output properties.
Thanks to below links:


Comments

Post a Comment

Popular posts from this blog

Powering Up Your Analytics: Exploring Power Query in Power BI

Power App Component Overview : Canvas App vs Model-Driven App

Exam PL-400: Microsoft Power Platform Developer