With code components, we can extend the capabilities of the Power Platform beyond what is offered out-of-the-box, letting us customize it according to specific business requirements. However, for these components to operate and be utilized effectively, they must have an appropriate and well-configured manifest to guide their function.
A code component manifest serves as the cornerstone for the use and operation of these components within the Power Platform.
It declares key pieces of information including its name, version, resources, and properties, allowing the Power Platform to recognize, understand, and operate the component effectively.
This file takes the form of a XML file, usually named ControlManifest.Input.xml, located in the component’s root folder. Here’s a basic sample structure of what a component manifest might look like:
In this sample:
- The ‘manifest’ block is the main frame that contains all the other elements.
- ‘Control namespace’, ‘constructor’, and ‘control-type’ describe the unique identity of your code component. Namespace and constructor together form the unique name of your control. The ‘control-type’ can be either ‘standard’ or ‘dataset’, based on whether you wish to work with single record or multiple records.
- The ‘display’ section contains details of how your component is displayed when integrated, including an optional infobox.
- ‘Resources’ are all the files that are necessary for the component to function properly including TypeScript files (.ts), Stylesheet files (.css), and resx files for localization.
- ‘Properties’ are defined per the business requirement and they are part of the component output.
Overall, code component manifests form an integral cog in the wheel that is Power Platform development.
Understanding them, how they need to be configured, and how they influence code components is vital knowledge for the PL-400 Microsoft Power Platform Developer examination, and for Power Platform development in general.
Keep in mind, every detail in the manifest is essential for the component’s operation, hence configuring it accurately according to your requirements is paramount. A well-configured manifest will ensure seamless operation and integration of your custom components within the Microsoft Power Platform, leading to more advanced and tailored solutions for your business needs.
Practice Test
True or False: The code component manifest, also referred to as the ControlManifest.Input.xml file, contains information about different controls and parameters in a component.
- Answer: True
Explanation: The code component manifest provides a definition of each control or parameter properties in a component.
In configuring a property in the code component manifest, there are three main attributes that should be defined. Which of these is not an attribute?
- a. Binding
- b. Usage
- c. PropertyType
- d. Text
Answer: d. Text
Explanation: Text is not an attribute while configuring a property in the code component manifest. The main attributes consist of PropertyType, Usage and Binding.
True or False: The resources section in the code component manifest contains scripts, CSS, and other resources required for the control.
- Answer: True
Explanation: These resources are necessary for the control to behave correctly, and are listed in the resources section of the code component manifest.
The config section in the code component manifest allows you to configure:
- a. Resources
- b. Properties
- c. Resources and properties
- d. None of the above
Answer: b. Properties
Explanation: The config section in the code component manifest is used to set up properties that can be configured in the PowerApps maker portal.
True or False: The Resources section of the ControlManifest.Input.xml file contains the list of the CSS and JS files that are going to be used by the PCF control.
- Answer: True
Explanation: The Resources section of the ControlManifest.Input.xml file lists down all the script and stylesheet files which the PCF control will be using.
What is not one of the possible types of resources in the resources section of a code component manifest?
- a. css
- b. xml
- c. js
- d. resx
Answer: b. xml
Explanation: While css, js, and resx are resources that can be defined in the resources section of a code component manifest, xml is not one of them.
What does the “property-set” tag do in the code component manifest?
- a. Defines a set of properties for the control
- b. Defines the properties of a set
- c. Defines a set of controls for a property
- d. Defines the control properties for a set
Answer: a. Defines a set of properties for the control
Explanation: The “property-set” tag in the code component manifest is used to define a set of properties and their characteristics for a control.
Another essential part of the component manifest is the “properties” section. What does this section provide?
- a. It provides a list of CSS and JS files.
- b. It provides property that will be available for configuring.
- c. It provides details about resources.
- d. It provides configuration details about datasets.
Answer: b. It provides property that will be available for configuring.
Explanation: The properties section in the component manifest provides definitions for any property(ies) that is available for configuring in the PowerApps maker portal.
True or False: The code component manifest only supports XML format.
- Answer: True
Explanation: The code component manifest, particularly the ControlManifest.Input.xml file, is written and maintained in XML format.
Can the code component manifest be used to describe dataset type controls?
- a. Yes
- b. No
Answer: a. Yes
Explanation: The code component manifest can also describe dataset type controls. A dataset type control shows a set of records from a specific entity.
Interview Questions
What is a code component manifest in the context of Microsoft Power Platform?
A code component manifest is an XML file (manifest file) that contains the metadata for the code component, such as the properties of the control and resources required for the control.
What are the components of a code component manifest file in Microsoft Power Platform?
The components of a code component manifest include Property Schema, Resources, Events, and Feature Usage. Each of these components provides critical information about how a code component functions and interacts with the system.
What is the role of Property Schema in a code component manifest file?
Property Schema defines the parameters or properties of the control and their types. It helps the control to interact with the data and other system entities.
What is the role of Resources element in a code component manifest file?
Resources element in a code component manifest file is used to specify the scripts, style-sheets, images, and other related resources required for the code component.
Can I edit the contents of a Code Component manifest file?
Yes, you can edit the contents of a code component manifest file to customize the behavior of the code component per project requirements.
What is the extension of a code component manifest file in the Microsoft Power Platform?
A code component manifest file in the Microsoft Power Platform uses the extension “.xml”.
Can you define the FeatureUsage element in a code component manifest file?
The FeatureUsage element in a code component manifest file is used to specify dependencies on system-defined features.
How is the data type of the properties expressed in a code component manifest file?
The data type of the properties is expressed using the “type” attribute in the Property element within the PropertySchema element.
What does the type attribute value “TwoOption” assign to a property in a code component manifest?
The type attribute value “TwoOption” assigns a boolean type value to the property.
What is the purpose of the “display-name-key” attribute in property definitions in a manifest file?
The “display-name-key” attribute is used to specify a locale-specific display name for the property.
What should be the format of image resource in code component manifest?
The image resource in code component manifest must be in .png format, and the preferred dimension is 32×32 pixels.
How do you define an event for a code component in a manifest file?
Events for a code component in a manifest file are defined using “event” elements inside the “events” element, specifying the name and associated handler.
What does the “unordered” attribute indicate in the context of a manifest file?
The “unordered” attribute, when set to true, indicates that the order of elements is not meaningful for the property.
What is the function of the “datasource” attribute in the Resources element?
The “datasource” attribute specifies data that the resource depends on. It can be a dataset, view, or an entity.
How can I verify my code component manifest file is valid?
You can use the Power Platform CLI to validate your manifest file using the “pac solution check” command.