Is it possible to add iframe or content block to the change request GUI?

humblecommitted
Kilo Guru

I was wondering if anyone in the community knew if we could have an iframe or content block that could display a url within a Change request?

For example, I would like to display a sharepoint site within an iframe/content block.

find_real_file.png

find_real_file.png

3 REPLIES 3

LaurentChicoine
Tera Guru

Yes you can add an iframe by using a UI Macro for your Iframe. You can then place this UI Macro on your form using a Formatter.



You could use Jelly script to use a URL in one of your field for the "src" of the iframe by using ${current.url_field_name} which would work on save or on load of an existing record with the URL populated.



Otherwise, you could add a <script> tag in your UI Macro and set a function to set the URL such as:



function setDisplayIframeSrc(url){


        var iframe = document.getElementById('id_of_your_iframe');


        iframe.src = url;


}



Then you could make an onChange client script on your URL field that would use that function to set the "src" of the iframe.


Hello Laurent,



I have not had a chance to try out your solution but I will give it a shot and come back on here to post my update.



Thank you for your support!


Hi Humble and committed student


You can just embed a URL to the change request in any variable question. You can use a label or single line text


Or you can use the UI Page variable type and try that. Below is the link on what a UI page is and how you can use it. I guess that will suffice your requirement.


http://wiki.servicenow.com/index.php?title=UI_Pages#gsc.tab=0



You can also check out this post, may give some pointers: Styling your Service Catalog form in Geneva