- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2022 11:33 PM
Hi Everyone,
I am recently introduced to iFrame. My task is to load external URL in ServiceNow console using iFrame in Classic UI and agent workspace. Can anyone guide me to achieve this.
cc: @kamlesh kjmar
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2022 10:16 PM
Hi @Abhijit Das7 ,
How you can achieve this depends on where you want your iframe to be embedded. For agent workspace it will not work as agent workspace do not allow such fields to render on form. To know list of field types supported by agen workspace refer to the link provided below:
Now, since you are looking to show this in agent workspace as well, I assume you need this in any form. For this you would require two things:
1. UI Macro - To embed the link as an iframe
2. Formatter - To link with UI Macro and allow to appear on form as a field.
You can refer to the steps below:
1. Create a UI Macro as shown below. In the below code replace src value with your site URL that you want to embed.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<iframe src="https://abc.xyz" height="900px" width="1800px"></iframe>
</j:jelly>
2. Create a formatter record and attach it with UI Macro created in step 1 and with the table where you want to include this, as shown below:
3. Now include your formatter on your form page by configuring form layout:
Finally your embedded link will appear on the form as an iframe
Please note iframe will work only when the url you are trying to embed allows it's site/page to be used as an iframe, otherwise you will get error loading.
I hope this helps.
Regards,
Kamlesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 12:06 AM
possible using UI page by adding iframe tag in classic UI
For workspace I doubt you can do
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 12:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 12:14 AM
inside UI page just add this
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<iframe src="some_url_source_here" width="400" height="400"></iframe>
</j:jelly>
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2022 10:16 PM
Hi @Abhijit Das7 ,
How you can achieve this depends on where you want your iframe to be embedded. For agent workspace it will not work as agent workspace do not allow such fields to render on form. To know list of field types supported by agen workspace refer to the link provided below:
Now, since you are looking to show this in agent workspace as well, I assume you need this in any form. For this you would require two things:
1. UI Macro - To embed the link as an iframe
2. Formatter - To link with UI Macro and allow to appear on form as a field.
You can refer to the steps below:
1. Create a UI Macro as shown below. In the below code replace src value with your site URL that you want to embed.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<iframe src="https://abc.xyz" height="900px" width="1800px"></iframe>
</j:jelly>
2. Create a formatter record and attach it with UI Macro created in step 1 and with the table where you want to include this, as shown below:
3. Now include your formatter on your form page by configuring form layout:
Finally your embedded link will appear on the form as an iframe
Please note iframe will work only when the url you are trying to embed allows it's site/page to be used as an iframe, otherwise you will get error loading.
I hope this helps.
Regards,
Kamlesh