Glide_var field types
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2022 08:06 AM
Hi Everyone,
Can anyone help me understand how can we parse glide_var type fields and separate their values. Only information I can find on internet is this link.
https://www.jds.net.au/glide-variables/
We need to store the values from this glide_var type field and use the same.
Please help if any idea about the same.
Regards,
Uday
- 2,635 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2022 04:14 AM
Hi
I don't understand your issue, as in the referenced web page there is an example on how to read the variable names and values:
var gr = new GlideRecord('<TABLE NAME>');
gr.get('<SYS ID>');
// 'inputs' is the name of the field of type 'glide_var'
for(var eachVariable in gr.inputs) {
gs.info(eachVariable + ' : ' + gr.inputs[eachVariable]);
}
What exactly do you miss?
Kind regards
Maik

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2022 09:29 PM
Hi Uday,
PFB the sample code, please mark the reply helpful as appropriate
var ordertaskGr= new GlideRecord('sn_ind_tmt_orm_order_task');//table name of the order task
ordertaskGr.get('244e9ff45b5620102dff5e92dc81c7bd'); //sys_id of the order task
for(var eachVariable in orderGr.characteristics) {
gs.info(eachVariable + ' : ' + orderGr.characteristics[eachVariable]);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2022 12:51 AM
This thread helped me in understanding and implementing the below solution what I was looking for:
var gr = new GlideRecord('sys_hub_action_instance')
gr.get('318450411b5c81104a61ebd22a4bcbc7')
for(var eachVariable in gr.action_inputs){
gs.info(eachVariable + ' : ' + gr.action_inputs[eachVariable])
}
//output
*** Script: sys_meta : action_inputs
*** Script: table_name : sc_req_item
*** Script: record :
*** Script: values : comments=Request has been processed in ServiceNow.^state=3^stage=complete
*** Script: sys_id : 318450411b5c81104a61ebd22a4bcbc7
Thanks,
Raghu.