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

Notifications

Announcements

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 428

#2
WarrenBelz Profile Picture

WarrenBelz 374 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 333 Super User 2025 Season 2

Last 30 days Overall leaderboard