Create a URL,which is referring to a record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 12:08 AM
Hi All,
I have a requirement to create a URL which should hit a particular record of the table.
The catch here is that currently we are having the sys_id of the record in the URL, due to which we are unable to hit the record with the URL as the sys_id of the column is not the correct way to hit it.
We need to have a mechanism such that we can pass the front end display value of the record along with the created date in URL so that we can hit the record.
Any suggestions how to achieve this would be much appreciated.
Thanks
- Labels:
-
Request Management
-
Service Desk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 12:15 AM
Hi,
Not sure what the exact use case is and why cant you use a reference field, which would solve all your problems. But to create a url with the sys_id, here it is:
https://<instance Name>.service-now.com/<table name>.do?sys_id=<sys_id of record>
You should already have the instance and the table name, you can pass the sys_id dynamically to generate the url.
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 12:36 AM
Hi Anurag,
Thanks for the response.
But the sys_ids are hard to remember.
The client has a ask, where can have a sample URL in which he can change the number directly in the URL and get the record open. the field he wants to use in the url is a reference type of field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 12:43 AM
Ohh ok now i get it.
Here you go
https://<baseURL>/nav_to.do?uri=<table name>.do?sysparm_query=<field=value>
EG
https://<instance name>.service-now.com/incident.do?sysparm_query=number=INC0010001
Reference: Examples of navigating by URL | ServiceNow Docs
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 12:52 AM
Hi Anurag,
I already tried the way you suggested, but the issue i am encountering here is because of the reference field.
if i use the above url, it says record not found, because SN gives sys id for every reference field in URL