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
2 hours 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
an hour ago - last edited an hour 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
55m ago
Refer these posts for the solution:
https://www.servicenow.com/community/itsm-forum/fill-catalog-variable-via-url/m-p/2748704
