- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2014 10:52 AM
Hopefully this is an easy one for someone. I added a URL field to my form for users to put specific web addresses (e.g, www.google.com). When they click on the URL, it is appending our instance name before the address (e.g, https://instancename.service-now.com/google.com). How do I prevent the instance name from appending?
Thanks,
Andy
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2014 07:43 PM
Hi Andrew,
From a similar question I recently answered: URL Field Type
When typing the URL into the field, "http://" or "https://" should be included before the URL. If you leave off the protocol, the url is treated as relative to the instance url. If you include the protocol, the url is treated as an absolute URL. So the url entered should read "http://www.google.com"
The requirement for the protocol prepended to the url is a HTML specification implemented by browsers themselves, so there is no way around that.
Within ServiceNow you could add a client script and/or business rule to check the url field for http:// and add it if it is not present. This would remove the requirement for users to include it themselves. For example:
Client Script
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
if ((newValue + '').indexOf('http://') == -1) {
g_form.setValue('url', 'http://' + newValue);
}
}
Business Rule (before)
(function() {
if ((current.url + '').indexOf('http://') == -1) {
current.url = 'http://' + current.url;
}
})();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2014 11:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2014 11:27 AM
Thanks for the reply. Unfortunately, that will not work for what I am trying to accomplish. There are hundreds of different urls in records and I attempted your suggestion and a it did not work. Do you have an idea where this is set?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2014 11:35 AM
Not sure if this will work, but try setting this property to nil:-
glide.email.override.url
Thanks & Regards,
Hari

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2014 11:37 AM
Hi Hari,
Just Fyi, Customers who want to display a custom base URL in email notifications can set the glide.email.override.url property.
Thanks,
Pradeep Sharma