How to get sys_id of request item created from catalog item in an onsubmit catalog client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2019 02:46 PM
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!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2019 03:34 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2019 04:02 PM
Hi:
I tried:
var sysval = gel('sysparm_item_guid').value;
alert(sysval);
but I get a console error that gel is not defined..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2019 04:48 PM
Hi try this instead:
var sysval = g_form.getSysId();
alert(sysval);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2019 04:52 PM
But wouldn't that give me the sys_id of the catalog item not the request item that it created? Thanks