Module - launch an external URL using a property
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2018 08:09 PM
Hi there,
I am trying to create a Module of Link type URL (from arguments) to launch an external URL. For a static URL it works fine but now I need to add the value of a System Property at the end of it.
For an example, I want to launch: https://externaldomain.com/{ValueOfASystemProperty}
I tried using javascript:gs.getProperty and things alike, but nothing seems to work. Any ideas?
Thanks,
Vipin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2018 09:20 PM
Hi Vipin,
The best option I can think of here is to create a UI page to redirect to the external domain. In this case, you can fetch the value via system property and have the dynamic URL. Once done you can call the UI page from the module via "URL from arguments".
Please let me know if you have any questions.
Thanks,
Pradeep Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2018 09:31 AM
Thanks Pradeep,
I'm now able to launch the external URL from Client Script section of HTML using this:
window.open(<myexternalurl>, '_blank');
But now my problem is that ServiceNow displays a blank page because there is no content in HTML section of my UI page. However can I redirect the current page back to previous?
I tried open the Module itself in new window (Window=_blank in Module) but then it opens a blank ServiceNow window with my UI page and another window with my external URL. So while my main ServiceNow window remains on the same page, I get this additional blank page for my UI page.
Is there a decent way to achieve it?
Thanks,
Vipin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2018 08:35 PM
Hi Vipin,
You should set the Window name field to blank in the module and then it will work fine i.e a new tab will be opened with the External URL and you will no longer see an additional blank page.
Can you please check and confirm?
-Pradeep Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2018 09:12 PM
Hi Pradeep,
Unfortunately not.
1. I tried the following where my UI page has nothing but it fetches the system property for the URL and then launches it from Client Script. The Module's Arguments point to this UI page and Window Name is empty.
Clicking this Module, launches a new tab with dynamic URL however it leaves a blank page in ServiceNow tab (certainly because the UI page does not have any content).
2. Now if I add "_blank" in the Module; the ServiceNow tab remains on the old page (as desired by me) but launches a new tab with blank page (for UI Page) and another tab with dynamic URL.
Thanks again,
Vipin