Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Get URL parameters and make catalog item variable change

MalikB
Tera Contributor

I have a need to create a need: how to get the value of a variable type lookup select box (Software/execution/application) which comes from the software application table which retrieves the value of the ID and class column, If a software_id parameter is entered in GET in the URL, if a software corresponds to this model number, it must be pre-selected. I created this client script to retrieve the parameter of the software_id url that said it provides me with the value of ID and class this number is linked to a software which has a title in the software application table according to the software_id value I want the variable of the catalog item software/execution/application to display by default when loading this software: function onLoad() {
//Type appropriate comment here, and begin script below
// var url = getParameterValue('url');
// var softwareId = getParameterValue('software_id');
var url = top.location.href;
var value = new URLSearchParams(url).get('software_id');
if (value) { g_form.setValue('var_application_logiciel_extention_list_2', value);
} }

0 REPLIES 0