V2 Text Component Merge Variable in IFrame URL

edited March 18, 2020 in Questions
I am using the HTML functionality of the TEXT component in V2 attempting to dynamically load an IFrame. 

I can't seem to get the syntax right. I am able to get the IFrame URL to work when I hard code the parameter. And I am able to see Merge Variables in the HTML when they are not in the IFrame URL, but syntax wise I think I am doing something wrong in the URL.

The following works when hardcoded

<iframe border="0" height="500px" src="https://instance--lightnings--skuid.cs37.visual.force.com/apex/skuid__ui?page=OppFiles2Zip&amp;id=0060B00000f3UUQQA2" style="border:none;" width="98%"></iframe>

but then I try to use the merge field inside the URL it doesn't work. If I place the merge field somewhere else outside of the iFrame tag I can see that its pulling the right value. For some reason the substitution is not happening.

<iframe border="0" height="500px" src="https://instance--lightnings--skuid.cs37.visual.force.com/apex/skuid__ui?page=OppFiles2Zip&amp;id={{Id}}" style="border:none;" width="98%"></iframe>

Is there special syntax that is needed within the src attribute of the HTML tag in the V2 Text component for it to recognize it needs to substitute the merge variable?

Comments

  • Mark DeSimoneMark DeSimone 🛠️ 
    edited March 10, 2020
    Hi Joseph,

    There was a product issue (DSC-1576) that was resolved in 12.2.12 that may be relevant here. Here's its description:
    "DSC-1576 - Affects v2

    Context unavailable for Wrapper component within a sliding panel
    Previously, data components within a Wrapper component within a sliding panel would not receive data from context. This meant that a row action in a Table component that launches a sliding panel would not pass row data into any components within Wrapper components within the sliding panel.

    Now, context data is passed through Wrapper components within sliding panels."

    If this is the root of your problem, using a global merge variable instead of a model/context specific variable should work if your target model just has one row. But another more flexible workaround here should be to move affected components outside of the wrapper or responsive grid.

    If this doesn't seem relevant to your issue, here are a couple follow-up questions:
    • Is your text component attached tot he model where the {{Id}} variable is?
    • Does a global merge variable like {{$Model.myModel.data.0.Id}} work, or yield the same problem?
  • edited March 11, 2020
    Hi Mark,

    The text component is attached to the model so the following works if placed above the iFrame

    ID is : {{Id}}<br />
    Global Merge : {{$Model.PrimeOpportunity.data.0.Id}}<br/>
    In both cases it shows the same ID. And if I statically type that ID into the src attribute of the iFrame everything works. But if I use either of these merge fields in the src attribute of the iFrame I get the error.

    It seems like the substitution is working within the Text component HTML but not when it is within the src attribute. Maybe there is some sort of formatting that is happening to the attributes (i.e. HTML encoding) before the substitution is trying to match causing the match to fail?

    Not sure, but if you drop in a text component, create an iFrame in the html and try to use a merge field in the src attribute it doesn't seem to be working.
  • Mark DeSimoneMark DeSimone 🛠️ 
    edited March 18, 2020
    Hi Joseph, do you see any error messages (even in the browser console) when the problem happens? 
    Also, please let me know which version of Skuid this is happening in.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!