Accessing URL Parameters in ServiceNow Forms
New article articles in ServiceNow Community
·
Jul 09, 2025
·
article
There are scenarios where you may need to retrieve specific parameters from the URL when a form loads. In such cases, the following code snippet can help:
Add this code within an onLoad client script:
var url = top.location.href; // retrieves the URL var parameter = new URLSearchParams(url).get(‘’); // Retrieves the value of the parameter
Thanks & Regards,
Subham Kumar Shaw
ServiceNow Architect/Consultant
ServiceNow Community Rising Star ' 2022/2023/2024
View original source
https://www.servicenow.com/community/developer-blog/accessing-url-parameters-in-servicenow-forms/ba-p/3316097