- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-18-2017 11:47 PM
Hi,
I am trying to pass the URL to clipboard by using the attached code in client script, but it works in IE browser and not for Chrome. Could you please suggest what change I can do on this code for working in Chrome browser?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2017 09:37 PM
Hi there,
I have tested the following code in IE 11, Chrome 62, and Firefox Quantum 57.
function onSubmit() {
var instanceName = "something";
var incidentURL = 'https://' + instanceName + '.service-now.com/incident.do?sys_id=' + g_form.getUniqueValue();
copyToClipboard(incidentURL);
}
ServiceNow provide this "copyToClipboard" function that can be used, which will cause the "Copied to clipboard" message within servicenow.
You could also use the code located on this PasteBin to accomplish the same thing silently. function onSubmit() { var instanceName = "something"; var incidentURL - Pastebin.com
Setup in Client Script as follows:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2017 05:13 AM
HI Ananad,
Could you please provide the more information on your requirement

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2017 05:48 PM
Most lists and breadcrumbs already have this functionality via the context menu.
What is your business requirement?
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2017 09:07 PM
Hi,
Our business requirement is to pass the URL to clipboard when the field is updated, so we are trying to do that from the client script with the above mentioned code.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2017 09:14 PM