Iframe with script so i get the current page incident details like subject , description upon click
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2025 12:32 AM
Hi Everyone,
I am able to create an iFrame inside the Incident page.
Now I want to auto populate those current Incident records like Incident Number & Incident Subject when I click on a process button so it auto populates those details into my A360 process.
Or
I have also created a Widget with scripts added there and I am able to add that widget in "Home" page only, I want to add that widget in the "Incident" page that will solve my problem very easily.
If anyone can help me with either of the issue, it would be so helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2025 12:50 AM
why not show UI page and pass the form field value to it and then use that in your UI page?
So you are showing widget on form but how? is it via some UI macro?
Did you try to access the current field value using current.fieldName in g:evaluate tag?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2025 01:18 AM
Yes, I have used UI macro to show iFrame inside each Incident Record Page, I have tried to get the values of each record page but i want to populate only when i click on my process button. I have attached the screenshot highlighted it with red color , so when i press that i should auto-populate those incident records to my form.
This is my code in UI Macro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2025 02:01 AM
in your UI macro get the record sysId or incident number
But I could see in iframe directly you are invoking the external URL, so I believe you cannot pass it there
The UI which gets rendered comes from external URL and is not within ServiceNow instance
Can you paste the URL here so that I can check in my PDI?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2025 02:46 AM
Hi Ankur,
I tried this way also where i create a Widget & then create a formatter & then add the same formatter in my incident page layout. This is the below steps:-
If your widget is built using Service Portal, follow these steps:
Steps to Add a Widget to the Incident Form
Create a Widget
- Navigate to Service Portal → Widgets.
- Click New and configure your widget.
Add the Widget to the Incident Form
- Go to System UI → Formatters.
- Click New.
- Enter:
- Name: Incident Widget
- Table: incident
- Formatter: sp_widget
- Widget: Select your newly created widget.
- Click Submit.
Modify the Incident Form Layout
- Navigate to System UI → Forms → Form Layout.
- Select the Incident Table.
- Under Available Fields, find your new formatter (e.g., Incident Widget).
- Move it to the Selected Fields section.
- Click Save.
I am able to perform this step & also add the same to my incident page but nothing seems to happen.
Also this is the URL:-
https://aa-saleseng-us-4sbx.cloud.automationanywhere.digital/copilot
I have attached how i created the System - Widget & added my iframe & Client Script , it works well when i add the iframe to my Home page but not when i do the same thing in Incident Page.
If required we can connect on zoom for 5-10 minutes to resolve the issue. Let me know.
Thanks for helping