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 Pages / Powerapps Portal: Pass...
Power Pages
Unanswered

Powerapps Portal: Pass parameters in IFrame src

(0) ShareShare
ReportReport
Posted on by 3

Hi all,

 

thank you in advance for your support.

I tried to pass parameters in IFrame scr (embedded in PowerApps Portal) with a field from Dynamics 365 (account). Is it possible to do this?

 

Best regards masn

 

Categories:
I have the same question (0)
  • OOlashyn Profile Picture
    3,496 Most Valuable Professional on at

    Hi @MASN ,

     

    How are you embedding an iframe to Power Apps Portal? I would suggest you embed an iframe by implementing custom template with liquid - it will allow you to securely fetch and pass necessary info to iframe src attribute directly.

     

    You can find more about liquid and custom templates in official docs.

     

  • MASN Profile Picture
    3 on at

    Hi OOlashyn,

     

    thank you. I have tried to embedd the Iframe to an component Webpage (template Full Page) with the standard component IFrame.

    /**<iframe frameborder="0"  src=".sourceurl.net?typename=account&amp;userlcid=...." scrolling="no" allowfullscreen="true" style="width: 1641; height: 741.25;"></iframe>**/
     
    something like this. The account should and the id should be the one from authentificated user. Maybe you have more ideas for this problem?
    But this is an ideas, I will try to implementing custom template with liquid.
    Thank you.

     

  • Christian Leverenz Profile Picture
    1,214 on at

    Hi @MASN ,

    as @OOlashyn pointed out, you should take a liquid template to render the iframe. The iframepart can be used as a single page template or may be embedded in other liquids, what comes in quite handy.

     

    So, given you know the id of the entity (e.g. a contact) you could go like the first part of the example (my liquid example for that).

     

    I personally prefer to do this kind of things with some javascript as pointed out in the second half of the example.

    Of course, the way you do it depends on the request your users have.

     

    If you access eintities from the crm, do not forget to enable entity permissions fior that specific entity. Else, you will not see data 🙂

    Another issue is, that you might have to set content-security-policy or x-frame-options on the site you want to embed. Some sites (like e.g. www.google.com) do not let themselves beeing embedded in an iframe.

    Also, the embedding page has to speak the same protocol, so it has to be https as portals are served via https.

    When you want to "talk" to the iframe, just use window.postmessage and register a handler on the embedded page (and on your page to be able to get answers as well 🙂 )

    One problem with the iframes is usually the handling of responsiveness. So, when i use that approach a have a communication between the two windows and on resize, the embedded page tells me the need for height and width and i have a listener on the hosting page to align the size of the iframe in order to avoid scrollbars.

     

    A lot of text, sorry, but may be, it helps.

     

    Have fun,

      Christian

    my liquid example:

    {% assign thiscontact = entities.contact["73CC4D87-0641-EA11-A812-000D3AB4653D"] %}
    {% if thiscontact %} 
    <div class="row"> 
    <div class="col-xs-12"> here the iframe will go if the contact exists... </div> 
    <div class="col-xs-12"> <iframe style="width: 100%; height: 300px;" src="https://www.bing.com?q={{thiscontact.fullname}}"></iframe> </div> </div> 
    {% endif %} 
    <div class="row"> 
    <div class="col-xs-12"> set the source based on code </div> 
    <div class="col-xs-8"> <input type="text" class="form-control" id="iframesrc"/> </div> 
    <div class="col-xs-4"> <input type="button" id="goforit" value="go"/> </div> 
    <div class="col-xs-12"> 
    <iframe id="tgtiframe" style="width: 100%; height: 300px;"></iframe> </div> </div> 
    <script language="javascript"> 
    var navigateIframe = function() { 
    var tgt = $("#tgtiframe"); 
    tgt.removeAttr("src"); 
    tgt.attr("src", $("#iframesrc").val()); 
    } $(document).ready(function() { 
    $("#iframesrc").change(navigateIframe); 
    $("#goforit").click(navigateIframe); }) 
    </script>

     ps the code was formatted using some external tool which may be made it syntactically incorrect. I do not know how to put in srccode here, the html was interpreted and i saw my iframes...

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 Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard