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.

How to get current catalog item name or sys_id using catalog client script?

jamesgo
Giga Contributor

I have a variable set that used by multiple catalog items, how to write a catalog client script to get the current catalog item information(name, sys_id, etc)?

11 REPLIES 11

Sanjeev Kumar1
Kilo Sage

Hi,

In any order guide item included in your cart at Step -2 ( choose options ). If you need to access this information at step - 2 look into UI Page " com.glideapp.servicecatalog_cat_item_guide_view " you can write some javaScript under "Client Script" .


Kumar35
Tera Expert

you still have access to g_form and g_form.getUniqueValue() will give you the current sys_id.
I hope this helps a bit.

cheers!


We tried using g_form.getUniqueValue() in an onSubmit Client Script and it returned a blank.


ryadavalli
Tera Expert

Hi James,



Were you able to get the sys_id of the catalog item in which we are in?



Thanks,