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 / How we can pass the po...
Power Apps
Unanswered

How we can pass the power apps data to a iframe

(0) ShareShare
ReportReport
Posted on by

I am trying to build an application in power apps and in that I am having multiple react component as an iframe but I want to utilize the powerapps dynamic data into react component is there any way that I can pass that data to the iframe dynamically

I have the same question (0)
  • Federico Pelliccia Profile Picture
    143 on at

    There is a real hidden method to pass the form context to an IFrame, you can find it here
    Basically you have to create a method in your iframe 

    // This script should be in the HTML web resource.
    // No usage of Xrm or formContext should happen until this method is called.
    function setClientApiContext(xrm, formContext) {
     // Optionally set Xrm and formContext as global variables on the page.
     window.Xrm = xrm;
     window._formContext = formContext;
     
     // Add script logic here that uses xrm or the formContext.
    }

    and you must implement the following code in you custom javascript called from you form

    // This should be in a script loaded on the form. 
    // form_onload is a handler for the form onload event.
    function form_onload(executionContext) {
     var formContext = executionContext.getFormContext();
     var wrControl = formContext.getControl("new_myWebResource.htm");
     if (wrControl) {
     wrControl.getContentWindow().then(
     function (contentWindow) {
     contentWindow.setClientApiContext(Xrm, formContext);
     }
     )
     }
    }

    With this method, you can pass both Xrm and formContext to your iframe, so you can read data from your form or from the database, without having to use parent.Xrm.Page (that is deprecated)



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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 88

#2
WarrenBelz Profile Picture

WarrenBelz 85 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 45

Last 30 days Overall leaderboard