- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 09:15 AM
Hello everyone,
I create a custom variable on my catalog item with the script below which open a ServiceNow page. I want to modify that
script to display the current URL of my instance.
Tab Default value :
{
"widget": "widget-link-button",
"href": "https://docs.servicenow.com/bundle/orlando-it-service-management/page/product/service-catalog-management/reference/r_VariableTypes.html",
"button_text": "SAPSubmit",
"color": "primary"
}
I have the following script on a ui page who help me do display the current URL but I want to display this current URL from the catalog item.
<script>
alert(window.location.href);
</script>
How can I modify my script on catalog custom variable to display the current ServiceNow URL ?
Thanks in advance,
Carole
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 10:42 AM
Hi,
Try creating new widget something like mentioned in the below image
and link the widget to your catalog item using custom variable type
Regards,
Mahesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 09:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 09:54 AM
Thanks for your answer.
How can I modify the following script to display the current servicenow URL ?
Tab "Default value" : (On a custom catalog item variable)
{
"widget": "widget-link-button",
"href": "https://docs.servicenow.com/bundle/orlando-it-service-management/page/product/service-catalog-management/reference/r_VariableTypes.html",
"button_text": "SAPSubmit",
"color": "primary"
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 10:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 10:25 AM
try the below
Tab "Default value" : (On a custom catalog item variable)
{
"widget": "widget-link-button",
"href": gs.getProperty('glide.servlet.uri')
"button_text": "SAPSubmit",
"color": "primary"
}