The JSONViewForm PCF (Power Apps Component Framework) control is designed to dynamically render form elements based on JSON data. It provides a flexible way to visualize and interact with JSON data within Power Apps.
- Dynamically generates form elements based on JSON data.
- Supports different input types for string, boolean, and numeric properties.
- Allows filtering form elements based on selected properties.
- Updates JSON data as the user interacts with the form elements.
- Provides error handling for invalid JSON input.
To use the JSONViewForm PCF control in your Power Apps environment, follow these steps:
- Build the PCF control using the provided source code. Or download solution from here
- Import the control solution into your Power Apps environment.
- Add the control to your desired app screen or form.
- JSONInput: The JSON data input used to dynamically generate the form.
- SelectedProperties: (Optional) Comma-separated list of property names from the JSON input. If provided, only these properties will be displayed on the form.
- FormFill: (Optional) The color value for form background.
- InputFill: (Optional) The color value for Input background.
- HeadingsFontSize: (Optional) The font size for form headings.
- ValuesFontSize: (Optional) The font size for form Values.
- HeadingsColor: (Optional) The Color for form headings.
- ValuesColor: (Optional) The Color for form input Values.
- Margins: (Optional) Specifies the form margins.
- Shadows: Shadow option for form inputs. Default = Off.
- Copy: Copy option for form JSON. Default = Off.
- Reset: Boolean parameter to reset the control (i.e UpdateContext({locResetForm: !locResetForm})).
- CurrentEvent: Output Property to output the current form event (FormLoaded,FormReset,ValueChanged,JsonCopied).
- CurrentKey: Output Property to output the current key changed.
- CurrentValue: Output Property to output the current value changed.
import { IInputs, IOutputs } from "./generated/ManifestTypes";
import './style/JSONViewForm.css'
export class JSONViewForm implements ComponentFramework.StandardControl<IInputs, IOutputs> {
// Implementation details...
}
Contributions to the JSONViewForm PCF control are welcome! To contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or fix.
- Make your changes and test thoroughly.
- Submit a pull request describing your changes.
The JSONViewForm PCF control is licensed under the MIT License.
This PCF control is authored by Shaheer Ahmad.