how to get RITM variables in Client callable script include, I am attaching the picture of code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2022 05:38 AM
how to get RITM variables in Client callable script include, I am attaching the picture of code.
get_Request_Details: function() {
var array = [];
var bsid = this.getParameter('sysparm_sys_id');
var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id', bsid);
gr.query();
gs.info("CHECK <<<<< 00:" + bsid);
if (gr.next()) {
var ff = gr.number;
var gf = gr.type;
var obj = {
type: gr.variables.type,
employee_type: gr.variables.employee_type,
report_to: gr.variables.report_to,
direct_reports: gr.variables.direct_reports,
preferred_first_name: gr.variables.preferred_first_name,
legal_name: gr.variables.legal_name,
work_in_location: gr.variables.work_in_location,
state_name: gr.variables.state_name,
};
}
array.push(obj);
gs.info("CHECK <<<<< :" + JSON.stringify(array) + "OBJ" + JSON.stringify(obj) +"<<<< "+ ff +"<<<< "+ gf);
I am gettiing the array object as empty log as mentioned below
[{"type":{},"report_to":{},"direct_reports":{},"preferred_first_name":{},"legal_name":{},"work_in_location":{},"state_name":{}}]OBJ{"type":{},"report_to":{},"direct_reports":{},"preferred_first_name":{},"legal_name":{},"work_in_location":{},"state_name":{}}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2022 05:44 AM
Hello,
The logic is set up so that if you call ... current.variables.type you will get the value of the selection.
https://docs.servicenow.com/en-US/bundle/sandiego-application-development/page/script/server-scripting/concept/c_ScriptableServiceCatalogVariables.html
Hope this helps!
Tudor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2022 08:28 AM
if am using current it's not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2022 05:52 AM
Hi,
Actually what is sys_id your sending ?? is this script calling from catalog client script or client script ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2022 08:27 AM
the sysid sending is RITM sysid , and the script include is calling from Catalog client script.
Mark my answer correct & Helpful, if Applicable.
Thanks,
Chandu Telu