sys_id of the catalog variable to be used in reference qualifier.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2018 06:17 AM
Hi,
I have a look up select box variable for a catalog item. It is referring to a custom table. I am using a reference qualifier to populate the choices. How can I pass the sys_id of this select box as a parameter to a script include via reference qualifier? I don't want to hard code the sys_id. Is there a way to achieve this?
Using current.sys_id will fetch me the catalog item's sys_id. I need the sys_id of the variable for which I am setting the options.
Thanks and regards,
Arnab Dash

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2018 06:23 AM
Try:
current.variables.variable_name.sys_id
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2018 06:29 AM
Hi Allen,
Have tried it.
javascript:gs.log('vlog: '+current.variables.static_data_look_up.sys_id);
Output:undefined
'static_data_look_up' is the variable_name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2018 06:35 AM
Can you explain why you need the variable's information to set its filter? Are you using the same table for multiple variables on the same form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2018 07:11 AM
Since the documentation online for the functions is thin, the best solution I could find was this:
var ques = current.variables.testing_ref.getGlideObject().getQuestion().getLabel();
var lookupQues = new GlideRecord('item_option_new');
lookupQues.addQuery('question_text',ques);
lookupQues.addQuery('cat_item','27ae7be1db221300205f793ebf96191e');
lookupQues.query();
if(lookupQues.next()){
gs.log(lookupQues.sys_id,'refTesting');
}