I want to fetch the "id" in URL from request type dynamically, instead of hardcoding.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2023 11:23 PM - edited ‎10-12-2023 12:59 AM
Hi All,
I want the user to be directed to ESC portal, for that I build the URL, there I am trying to fetch the details like sysId and table class name dynamically. But I am not getting how to fetch the "id"(red colored.
https://servicenow_my_instance/esc?id=ticket&table=incident&sys_id=000058a3472b29103e7ea31c016d43a8
Kindly Guide how to fetch this id based on request type like incident, request item, request, problem, change etc.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2023 12:15 AM
Hi @Community Alums,
This article explains what you need to do:
How to decode URL parameters using client script - Support and Troubleshooting (servicenow.com)
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2023 12:55 AM
Hi @Peter Bodelier
Thanks for the response, I don't want to debug the URL. But I want to know how this id is coming. Because it is changing as per request type, like for request it is order_status, for incident it is ticket. So I want to know how we can know on the basis of table class that id will be what?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2023 01:00 AM
Hi @Community Alums
That was not really clear in your question.
Can you tell the steps you take, to see the URL, that gives some more direction, to what method is used.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2023 12:15 AM
Hi @Community Alums ,
Try data.id = $sp.getParameter("id");
Please check and Mark Helpful and Correct if it really helps you.
Regards,
Mayur Shardul