How to Populate a Catalog Item Field (configuration_item) Using URL Parameters in ServiceNow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
How can I populate the configuration_item field on a ServiceNow catalog item by passing a parameter in the URL? I want the field to auto-fill when the user opens the catalog item through a specific link.
If you want, I can also give you the exact script + URL format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
You can try this catalog client script
function onLoad() {
// Manually parse the URL parameters
var test = getParameterValue('yourpaarmeter'); // Get the parameter from the URL
if (test) {
g_form.setValue('varaiable_name", requestedItem);
}
function getParameterValue(name) {
var url = top.location.href;
var value = new URLSearchParams(url).get(name);
return value ? value : '';
}
}
Hope that Helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Refer these posts for the solution:
https://www.servicenow.com/community/itsm-forum/fill-catalog-variable-via-url/m-p/2748704
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @deepakm29284933
Please refer to the link below for detailed guidance on how to populate catalog variable values from a URL in ServiceNow:
https://snprotips.com/setting-catalog-item-variables-from-url/
If you find this response helpful, please consider marking it as Correct and Helpful. You may select more than one reply as an accepted solution.
