How can i split a url and take out the sys_id value and use in a variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2017 12:35 AM
URL=ServiceNow
I want to take the url of the current page and get the value of sys_id used in the url .
How to get the value of sys_id if I want to use it my script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2017 03:13 AM
Hi Karun,
If you are using a client script then use g_form.getUniqueValue()
If you are using a business rule you can use current.sys_id
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2017 12:25 AM
@alikutty karupamveetil .No I think u miss undershoot me i know how to take out sys_id.
what my actual requirement is i want to take out sys_id but using url from the parameter not copy the record get sys_id or something.
Just get the url and take out the sys_id parameter from the url.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2017 04:01 AM
Please try this and let me know, The code gets sys_id from URL
var url = document.URL.parseQuery();
if (url['sys_id']) {
url = decodeURI(url['sys_id']);
}
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2017 07:33 AM
okay i will try this.