- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 04:57 AM
I am trying to build this URL in a email script.
https://myinstance.com/now/sow/record/sc_req_item/b55508be974ebd10680c3bafe153af6c/params/extra-params/subTabIndex%2F1/selected-tab-index/1/sub/record/sysapproval_approver/c65548be974ebd10680c3bafe153af12
This is for approval. Can someone help me with this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 12:09 AM
Managed to build the URL and it is as follows.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 05:20 AM
You can generate a vairable URL by making the sys_ids variable, please check below:
Considering this is your actual link: https://myinstance.com/now/sow/record/sc_req_item/b55508be974ebd10680c3bafe153af6c/params/extra-params/subTabIndex%2F1/selected-tab-index/1/sub/record/sysapproval_approver/c65548be974ebd10680c3bafe153af12
Take "b55508be974ebd10680c3bafe153af6c" into a variable. Call this using GlideRecord Query
Take "c65548be974ebd10680c3bafe153af12" also into a variable and call it using GlideRecord Query.
Your script will look similar to this:
// Capturing the first sysid into a variable
var gr = new GlideRecord("your table name");
gr.addQuery("name", "value");
gr.query();
if (gr.next()) {
var sysID1 = gr.sys_id;
}
// Capturing the second sysid into a variable
var gr2 = new GlideRecord("your table name");
gr2.addQuery("name", "value");
gr2.query();
if (gr2.next()) {
var sysID2 = gr2.sys_id;
}
var actualUrl = gs.getProperty('glide.servlet.uri') + "now/sow/record/sc_req_item/" + sysID1 + "/params/extra-params/subTabIndex%2F1/selected-tab-index/1/sub/record/sysapproval_approver/" + sysID2;
template.print(actualUrl);
Mark it correct or helpful if it helps you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 12:05 AM
@vidhya_mouli if your issue is resolved, please mark an answer Correct. This way the thread will be closed and it will help other users too.
Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 05:21 AM
Hello there,
You can try below snippet:
var instance = "dev@service-now.com";
<a href="https://' + instance + '/now/sow/record/sc_req_item/b55508be974ebd10680c3bafe153af6c/params/extra-params/subTabIndex%2F1/selected-tab-index/1/sub/record/sysapproval_approver/c65548be974ebd10680c3bafe153af12">Link_Name</a>
Instead RITM sys_id and Approval sys_id, user current.field and it will work.
Thanks.
Geetanjali K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 05:23 AM
should be simple
email is on which table? I assume it's sysapproval_approver then no need of email script
directly add in email body since the only thing dynamic is the sysId of the record
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader