Karthik1212
Nintex Observer

Workflow in an iframe with URL parameter

Jump to solution

Hi,

 

We are using Nintex Workflow embedded in our website using the iframe code it gives when we publish the workflow. It works well. 

However, we would like to pass a URL parameter to it from the parent window (the website page).

How can we do this as when I tried to pass the URL parameter using simple javascript like the below doesn't work.

It doesn't even seem to call the onload function. When I remove the script tag for the ntx-embed-iframe.js, it does call the function.

Please help.
<body onload="setTheId()">
  <script src="https://sample.workflowcloud.com/embedform/iframe/ntx-embed-iframe.js"
    data-id="ntxFormContainer-sampleworkflowid"></script>
  <iframe
    id="ntxFormContainer-sampleworkflowid" scrolling="no" style="width:100%; border:none;"
    height="100%"
    src="https://sampleworkflowid.workflowcloud.com/embedform/iframe?id=sampleworkflowid">
  </iframe>
  <script>
    function setTheId() {
      alert('in the function');
      var loc = window.location.toString();
      var params = loc.split('?')[1];
      iframe = document.getElementById('ntxFormContainer-sampleworkflowid');
      console.log(params);
      console.log(iframe.src + '&' + params);
      iframe.src=iframe.src + '&' + params;
    }
  </script>
</body>
 
Tags (3)
0 Kudos
Reply
1 Reply
Jake
Nintex Employee
Nintex Employee

Re: Workflow in an iframe with URL parameter

Jump to solution

Hi Karthik,

 

I believe at the time of you posting this it was a known issue.

 

however since then i believe the developers have fixed the issue and i am successfully able to return query string parameters from the parent URL into an iframe, Please feel free to use my below form example with the query string parameter of zzz

<script src="https://ntx-amdemoemea.workflowcloud.com/embedform/iframe/ntx-embed-iframe.js" data-id="ntxFormContainer-896fad9f-fd3a-424a-8540-a0e631a40134"></script>
<iframe id="ntxFormContainer-896fad9f-fd3a-424a-8540-a0e631a40134" scrolling="no" style="width:100%; border:none;" height="100%" src="https://ntx-amdemoemea.workflowcloud.com/embedform/iframe?id=896fad9f-fd3a-424a-8540-a0e631a40134&tenancy=ntx-amdemoemea.workflowcloud.com&"></iframe>

 

please see the screenshot of it working on the w3 site.

 

Jake_0-1597311029326.png

 

View solution in original post

Tags (1)
Reply