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

it's easy.. you will have to just do : If you want to do it by Vanialla Javascript, just do :



document.getElementById('sysparm_id').value();



or you can do gel('sysparm_id').value


thanks abhiram.. sorry that you had to write at many places !!


Julian Hoch
ServiceNow Employee
ServiceNow Employee

Event better would be: g_form.getParameter("sysparm_id")


This does not require a DOM query, which is not recommended.


when I run g_form.getParameter("sysparm_id") on order guide it gives me blank value but it works perfectly on catalog Items.


Hi Sachin,


http://www.servicenowguru.com/reporting/identify-servicenow-record-producer-create-record/


Sir Mark Stanger has provided this solution when in past we asked for similar kind of question.


May be this will also help you.