- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2023 04:50 AM - edited 04-07-2023 04:55 AM
From UI action, we have outbound API call to external system as response they are sending html code and it has to be opened in iframe or new page, it will be external page not ServiceNow page.
I am receiving the HTML code, now I am not sure how to open it in new page or iframe. Kindly let me know if this is possible.
Thanks Gowri
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2023 11:24 PM
The solution to open in new page using window.open with form hidden inputs as similar to below Reference
javascript - Window.open and pass parameters by post method - Stack Overflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2023 05:08 AM
1) Can you share some snippet or show me the response?
2) From where in ServiceNow you are getting the response(script include/ client script)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2023 05:19 AM - edited 04-07-2023 05:20 AM
Hi Prince,
1) Can you share some snippet or show me the response?
I couldn't share the screenshot, but I can give you sample structure for response:
<!doctype html><html lang="en"><head>....</head><body>...</body></html>
2) From where in ServiceNow you are getting the response(script include/ client script)?
From UI action client script -> calling script include function -> rest message for outbound API ->response from script include is return to UI action.
Thanks,
Gowri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2023 05:31 AM
@Gowri S ,
Can you try one thing,
Once you got response back in UI action script from the script include, you can render the data using GlideModal API like mentioned below:
I am assuming your UI action would be of Client Side (Client side UI action has more flexibility for UI operations)
var htmlData = YOUR HTML RESPONSE;
var gm = new GlideModal();
gm.setTitle("Response Data");
gm.setWidth(550);
gm.renderWithContent(htmlData);
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2023 08:44 AM