web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / embed code app in mode...
Power Apps
Suggested Answer

embed code app in model driven app

(0) ShareShare
ReportReport
Posted on by Microsoft Employee
Hi have made a code app that i want to embed on a the account form, displaying information related to the account. I am following this guide: https://learn.microsoft.com/en-us/power-apps/developer/code-apps/how-to/embed-iframe 
But i cant get it working. I have tried using a html webresource for the embeding (including javascript to fetch the id from the context) and i have also tried using the webpage (url) component in the form editor.

Have anyone done this succefully and can share the steps? 

Thanks
Categories:
I have the same question (0)
  • Suggested answer
    11manish Profile Picture
    2,625 on at
    Yes, embedding a code app in a model-driven form is possible, but it requires using an HTML web resource with a dynamically constructed iframe URL that includes the record ID.
     
    The key is to pass the Account ID from the form using JavaScript and consume it in the app using Param().
     
    However, this approach has limitations,below link will be helpf to embed 
     
     
  • Suggested answer
    TechFreak Profile Picture
    149 on at

    Hi,

    Yes, this can be achieved successfully. I have implemented a similar requirement by embedding a code app into a model-driven form.

    Steps to achieve this:


    1. Create your custom page (HTML/JS/CSS)
      Build the UI using HTML, CSS, and JavaScript based on your requirement.

    2. Retrieve the current record context
      Use the execution context or the Xrm API to fetch details of the current record (for example, Account ID). This ensures that the embedded app displays data specific to the selected record.
       
    3. Pass the record ID to your page
      You can retrieve the record ID using:

      var formContext = executionContext.getFormContext();
      var recordId = formContext.data.entity.getId();

      Then use this ID in your page logic to fetch and display related data.

    4. Create and upload a Web Resource

      • Add your HTML file as a Web Resource in your solution

      • Include your JavaScript within the HTML or as a separate JS web resource. 

    5. Embed in the form

      • Open the form editor

      • Add a Web Resource control

      • Select your HTML web resource

      • Pass parameters (like record ID) if needed

      •  
    6. Alternative approach (URL / IFrame)

      You can also use the URL (iframe) option, but in that case ensure:

      • Proper parameter passing (record ID in query string)

      • The page is accessible and allows embedding 

    Key Point

    The most important part is correctly retrieving and passing the current record context, otherwise the embedded page will not show record-specific data.

     
     

    If this helps resolve your issue, please mark the answer as accepted and give it a like. It helps others in the community and contributes to knowledge sharing. Thanks!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 414

#2
Valantis Profile Picture

Valantis 408

#3
timl Profile Picture

timl 339 Super User 2026 Season 1

Last 30 days Overall leaderboard