Loading...

What is powerapps-modals?

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?

189830933-f09313aa-1229-4d18-84bf-acfe3cb8f8b4.png

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?

  1. Install the zip files in your environment
  2. 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",
      },
    ],
  }
  1. 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 more
Vite apps
Vite apps

Vite apps

Share post:

Related posts

Power BI vs Power Apps: Which Microsoft Power Platform Tool is Better for Your Career?

Introduction Microsoft Power Platform has become one of the fastest-growing technology ecosystems in the world. Organizations across industrie...

18 hours ago

Power Apps vs Power Automate: Which Microsoft Power Platform Skill Should You Learn?

Introduction Microsoft Power Platform has revolutionized the way organizations build business applications and automate workflows. With low-co...

2 days ago

Transforming Procurement with Microsoft Power Apps: From Manual Processes to Intelligent Operations

Microsoft Power Apps enables organizations to build tailored procurement applications without extensive custom development. By creating a cent...

5 days ago

Top 25 Real-World Power Apps Projects Every Fresher Should Build Before Applying for Jobs

Introduction One of the biggest mistakes fresh graduates make while preparing for Microsoft Power Platform Developer interviews is focusing on...

8 days ago

Offline-First Canvas Apps Grow Up: Real-Time Dataverse Access Arrives

A field technician I shadowed on a project once put it perfectly: "The app works great in the parking lot and dies in the basement — and...

10 days ago

Did You Know | Power Apps Code Apps have a new CLI (power-apps) that replaces ‘pac code’

If you have been building Power Apps Code Apps with the pac code commands, there is a new CLI you should know about. The power-apps npm CLI is...

10 days ago

Power Apps Code Apps | power-apps  authorization error | Reason and fix

In my previous post, Power Apps Code Apps – Trigger a Power Automate Flow, I walked through adding and calling a cloud flow from a code a...

11 days ago

How to Backup a Microsoft Power Pages (Power Apps Portals) Website

Microsoft Power Pages (formerly known as Power Apps Portals) is a low-code platform for building secure, external-facing websites that integra...

13 days ago

Power Apps – Entity scoping in global search

We are announcing entity scoping in global search in Power Apps. This feature will reach public preview on August 7, 2026. How does this affec...

15 days ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy