- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2024 12:01 PM
I have added variable "Task Number" (name = number) referencing to incident table on standard laptop catalog item form (catalog item sysid = 04b7e94b4f7b4200086eeed18110c7fd). Now I want to auto populate the incident number "INC0000001" in Task Number field on catalog item form using url parameter.
I am new to this configuration. Please help me achieve the same.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2024 01:09 AM
Try as below :
1. Create a Variable for Task Number :
2. Configure an On-Load Catalog Client Script as shown below. Ensure that Isolate Script is set to False :
function onLoad() {
//Type appropriate comment here, and begin script below
var taskNumber = getParameterValue('number');
if (taskNumber) {
g_form.setValue('number', taskNumber);
}
function getParameterValue(number) {
var url = window.location.href;
var value = new URLSearchParams(url).get(number);
if (value) {
return value;
}
}
}
3. Hit the Catalog Item URL with number as the parameter. I have made use of the URL https://<myinstance>.service-now.com/now/nav/ui/classic/params/target/com.glideapp.servicecatalog_ca...
Output :
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2024 09:15 PM
Please refer below link and see if it helps :
https://www.servicenow.com/community/itsm-forum/fill-catalog-variable-via-url/m-p/2748704
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2024 10:41 AM
Hi tried using above solution and used below url
instance.name/now/nav/ui/classic/params/target/com.glideapp.servicecatalog_cat_item_view.do%3Fv%3D1%26sysparm_id%3D04b7e94b4f7b4200086eeed18110c7fd%26task_number%3DINC0010017
But the incident number INC0010017 is not populating in task number
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2024 01:09 AM
Try as below :
1. Create a Variable for Task Number :
2. Configure an On-Load Catalog Client Script as shown below. Ensure that Isolate Script is set to False :
function onLoad() {
//Type appropriate comment here, and begin script below
var taskNumber = getParameterValue('number');
if (taskNumber) {
g_form.setValue('number', taskNumber);
}
function getParameterValue(number) {
var url = window.location.href;
var value = new URLSearchParams(url).get(number);
if (value) {
return value;
}
}
}
3. Hit the Catalog Item URL with number as the parameter. I have made use of the URL https://<myinstance>.service-now.com/now/nav/ui/classic/params/target/com.glideapp.servicecatalog_ca...
Output :
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2024 11:56 PM
Amazing @Amit Verma,
The isolate script option in my catalog client script was true, I inactivated it and it worked.
Thank you so much, Much Appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2024 11:49 PM
Hello @Ankita Gupte ,
You can try this by creating onload catalog client script to set value of task no. and use below URL format and update it:
https://<instance_name>.service-now.com/sp?id=sc_cat_item&sys_id=<catalog_item_sysid>&sysparm_task_n...
Thank you!!
Dnyaneshwaree Satpute
Tera Guru