How to get sys_id of request item created from catalog item in an onsubmit catalog client script

ritaaudi
Tera Contributor

Hi: Anyone know how to get the sys_id of the request item created in an onSubmit catalog client script?

I tried :g_form.getUniqueValue();

but that gives me the sys_id of the catalog item not request item created from it.

Thank you!

7 REPLIES 7

Abhishek Pidwa
Kilo Guru

Hello ,

 

I believe you can use gel('sysparm_item_guid').value

 

https://community.servicenow.com/community?id=community_question&sys_id=4ffe8ba1dbdcdbc01dcaf3231f961920

 

However not a big fan of DOM manipulation. But seems that that is the way to get the sys_id . It will either give you sys_id of request or request item. Try it.

 

Please mark this answer as correct/helpful if this solves your problem

ritaaudi
Tera Contributor

Hi:

I tried:

var sysval = gel('sysparm_item_guid').value;

alert(sysval);

but I get a console error that gel is not defined..

reginabautista
Kilo Sage

Hi try this instead:

 

var sysval = g_form.getSysId();

alert(sysval);

 

ritaaudi
Tera Contributor

But wouldn't that give me the sys_id of the catalog item not the request item that it created? Thanks