I want to fetch the "id" in URL from request type dynamically, instead of hardcoding.

Community Alums
Not applicable

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

7 REPLIES 7

Peter Bodelier
Giga Sage

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.

Community Alums
Not applicable

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?

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.

Mayur2109
Kilo Sage
Kilo Sage

Hi @Community Alums ,

Try data.id = $sp.getParameter("id");

 

Please check and Mark Helpful and Correct if it really helps you.

Regards,
Mayur Shardul