What is powerapps-modals?
Overview
powerapps-modals gives you the tool to build attractive modals in Model-driven apps fast & easy. You just need to configure the modal configuration and start calling it from your client code.
Why?

Roadmap
Click here to see the roadmap of powerapps-modals
Installation
Go to this link and download the latest release managed zip file, and then install it in your environment
How to use?
- Install the zip files in your environment
- Prepare your Json
{
"icon": "success",//warning //error
"labels": [
{ "text": "Activation Succeeded", "type": "h1" },
{
"text": "Enter customer name and email to submit the request to the next stage",
"type": "h2",
},
],
"inputs": [
{
"id": "customername", //used to get the value when the modal object is returned
"label": "Customer Name",
},
{
"id": "customeremail",
"label": "Customer Email",
},
],
"buttons": [
{
"id": "button-cancel", //used to know what button was clicked, retunred with modal return object
"label": "Cancel",
"type": "white", //blue //red
},
{
"id": "button-submit",
"label": "Submit",
"type": "blue",
},
],
}
- Call it from your script
let pageInput: Xrm.Navigation.PageInputHtmlWebResource = {
pageType: "webresource",
webresourceName: "vite_/viteapps/pages/modals.html",
data: JSON.stringify(modalJsonObject), //modalJsonObject, pass your json object here
};
let navigationOptions: Xrm.Navigation.NavigationOptions = {
target: 2, // 2 is for opening the page as a dialog.
width: 400, // default is px. can be specified in % as well.
height: 500, // default is px. can be specified in % as well.
position: 1, // Specify 1 to open the dialog in center; 2 to open the dialog on the side. Default is 1 (center).
title: "Record activation modal", //recommended to enter title here
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
function success(returnedValues) {
console.log(returnedValues);
/*
Return values object comes in the below format
{
inputs:object //holds the inputs and what the user filled them in with, you can get them by using the input id as the identifier
clickedButton:string // the id of the button the user clicked
}
for the above example you can get your inputs like the below
*/
let clickedButton = returnedValues.clickedButton; //if the user clicked on submit button it will return "button-submit"
let customerName = returnedValues.inputs["customername"]; //returns what user filled in the customer name input
let customerEmail = returnedValues.inputs["customeremail"]; //returns what user filled in the customer email input
},
function error(e) {
// Handle errors
}
);
That's it :)
Published on:
Learn moreRelated posts
Power Apps – Use streamlined header and navigation for better viewing
We are announcing the release of the streamlined header and navigation experience for app shell, form pages, and view pages within the Power A...
Power Apps – Use the Public Preview npm-based CLI to discover, create, and wire connectors in code apps
We are announcing the ability to use the npm-based CLI (Command Line Interface) to discover, create, and wire connectors in code apps in Power...
How To Create Copilot Custom UI Widgets In Power Apps
You can use Copilot to show custom UI widgets built-in Power Apps. UI widgets replace ... The post How To Create Copilot Custom UI Widgets In ...
Power Apps Fundamentals + Microsoft Fabric Integration Series # 1: Introduction to Power Apps and Microsoft Fabric: Building a Unified Business Application Platform
Introduction Modern organizations generate enormous amounts of operational and analytical data every day. Business users need applications to ...
Power Apps- Enhance row summaries in model-driven apps
We are announcing the ability to enhance row summaries in model-driven apps in Power Apps. This feature will reach general availability on Jun...
Calling Dataverse Actions and Functions from Power Apps Code Apps
When building Power Apps code apps, one of the most powerful things you can do is reach directly into Dataverse to trigger business logic. Whe...
Respond to a Power Automate Flow Approval in a Power Apps Custom Page or Canvas App
How to respond to Power Automate approval requests directly within a Power Apps custom page or canvas app, rather than email buttons or in Mi...
Inside Built-In and Custom Copilot UI Widgets powered by Power Apps
Custom app-powered Widgets feels like one of those shifts that will change how we think about Copilot experiences. Until recently, a lot of th...
Video: Transform Copilot With Custom UI Widgets Built In Power Apps
What you’re looking at here in Copilot is an interactive widget that I built with ... The post Video: Transform Copilot With Custom UI Widgets...
How to Automate Project Assignment in Dynamics 365 Using Power Automate and Power Apps Code Apps
This blog demonstrates how to automate project assignments in Microsoft Dynamics 365 using Microsoft Power Automate and Power Apps Code Apps, ...