PCF Controls are custom ways to interact with your Dynamics 365 or Power Platform data within model-driven or canvas apps. The name PCF comes from the Power Apps Component Framework (PCF), which is the framework within which you’ll develop them – creating custom inputs, form components, data displays, and even entire custom pages.
Parts of the Power Platform and the Dynamics 365 system can be considered low or no-code, but writing new PCF controls does require coding in Typescript which is Javascript with syntax for types.
Some examples of PCF controls include:
- Custom grids to show different records
- Maps based on data
- Custom buttons within forms
Here’s some tips for getting started with PCF controls:
1. Don’t reinvent the wheel. Before you get started developing a new control, take a look at PCF Gallery, a wonderful, large collection of custom controls created by the Power Platform community. If you find something that looks like it’s what you’re after, or is just slightly different, consider downloading the control and slightly modifying it to suit your requirements – provided it’s within the constraints of the license.
2. Take a look at some existing controls and how they work first. Microsoft Learn is always a great place to get started, and they handily provide a repository of sample code. Take a look at these, and if you have a development environment set up, consider installing them so that you understand a) the code, b) how they work within solutions, c) how to install them and d) how they interact with your environment.
3. Set up your environment early. There’s lots of helpful articles online from experts within the community about how to get set up. A good place to start is:
- Set up a suitable development environment, your VS Code workspace, and install the required CLI and applications if you don’t have them already.
- Start with the tutorial on Microsoft Learn.
- Take a look at the structure of a base PCF project – in particular, the index.ts file where you’ll find your base class and access to the context object (which contains lots of goodies) and the ControlManifestInput.xml file where you’ll manage the details about your control including it’s name, the fields or datasets it will use, the version number, and the features it will use. If you’re going to use the Web API within your code for example (e.g. to retrieve, update or delete records), make sure that you enable it in this file!
- Start having a go at creating some custom controls within a safe, properly configured development environment with sample data.
- Consider optimising your development workflow by using tools such as the Fiddler Autoresponder to speed up testing and debugging.
4. Use the fantastic resource that is the Power Platform Community if you need help. The Power Platform Community, hosted by Microsoft is a forum that boasts a large membership including highly skilled experts from the development community. Make sure you Google any issues first, but then consider posting a question if you need help.
5. Seek expert support if you need it. PCF is a great framework, but it does require a base level of existing coding skills and knowledge about the Dataverse and Power Platform. If you don’t have the capability within your team at the moment (or the time!) consider reaching out to Orby for a free initial conversation regarding PCF controls or the wider Power Platform/Dynamics 365 system.