Pre-populate a record producer form after clicking link on the Catalog Item

VAMSI AMMISETTY
Tera Contributor

Hello Everyone,

 

I have a requirement when requester clicks on the description "LINK" it have a target to open a record producer "Create Incident". 

Vamsi43_0-1682602446248.png

 

I want to preset values with ""Urgency = High && Impacted Service = Access card"". 

 

Vamsi43_1-1682602518868.png

 

Can you please help me on how to code ?

Thanks

4 REPLIES 4

Joe S1
Kilo Sage

Hello Vamsi,

 

You should be able to do this with an OnLoad Catalog Client Script. Something similar to this should work.

function onLoad() {
   //Type appropriate comment here, and begin script below
    g_form.setValue('u_urgency', 1);
    g_form.setValue('u_impacted_service', 'Access Card');
   
}

 

Hello @Joe S1 

it should populate the values only after navigating from URL of previous catalog item only.

Sorry missed that,

 

You're going to need to set the values via the url, see if this previous post helps.

https://www.servicenow.com/community/itsm-forum/passing-a-value-via-url-into-a-record-producer/m-p/4...

 

Slava Savitsky
Giga Sage

You will need to parse the URL parameters in an onLoad catalog client script. The following article explains how to do it: https://servicenowguru.com/scripting/client-scripts-scripting/parse-url-parameters-client-script/