- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2019 04:36 AM
Hi,
We currently have a content management portal and are moving to service portal. We currently have a link from a content block to an external URL but we also pass specific information on open so that the external site knows what user 'welcome' (from the user ID), and that it opens in an optimum sized window.
ie:
window.open("https://<website address>/?un=${gs.getUserName()}", 'popup',
'location=no,toolbar=no,menubar=no,scrollbars=yes,width=760,height=600');
Can someone please let me know how we can do this with an icon link widget? (Or any other widget as long as I can get it looking roughly the same as an Icon link) At the moment we have the target specified in the widget instance as _blank to open in a new tab:
{
"target": {
"value":"_blank"
},
"link_template": {
"value": "Circle Icon",
"displayValue": "Circle Icon"
}
}
thanks in advance.
Solved! Go to Solution.
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2019 02:42 AM
Hi,
a simply way on how you can achieve this, shwon in the image attached bellow:
Hope it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2019 07:12 AM
Hello,
Instead of using window.open , use location.href = "your url" . Refer to below code for reference and usage . Now here you can parse the data using &data1=123&data2=345 etc
function check()
{
var url = new URL(location.href);
var c = url.searchParams.get("sysparm_sys_id");
var strconfirm = confirm("Do you want to redirect ?");
if (strconfirm == true) {
location.href="/incident.do?sys_id="+c;
}
else{
return false;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2019 03:59 AM
Hi,
Thank you - so sorry to ask what may seem a dumb question, but where would that script go?
in the Icon link we have the Type set to URL and our URL is in the URL field and then we have the "target" specified in the widget instance under the Presentation/Additional options, JSON format field, so where would the script you mention need to go and do we need to change anything else? Thank you 🙂
At the moment we have the target specified in the widget instance as _blank to open in a new tab:
{
"target": {
"value":"_blank"
},
"link_template": {
"value": "Circle Icon",
"displayValue": "Circle Icon"
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2019 02:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2019 08:32 AM
Thank you so much! You're a star - it works a treat!