
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2019 02:37 PM
I am trying to get a variable sys_id in a workflow. I am setting many variable from the work flow but getting the sys_id for this one variable is not working for me. How can I get the variable sys _is for this one variable in the workflow?
var gateway = current.variables.Gateway.getValue();
var ritm_sys_id = current.sys_id.getValue();
var ritm = current.number.getValue();
var ans_state_sys_id = current.variables.AnsState.sys_id; (How can I get the sys_id for this variable? )
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2019 02:55 PM
Can we try something like this?
var gateway = current.variables.Gateway.getValue(); var ritm_sys_id = current.sys_id.getValue(); var ritm = current.number.getValue(); var ans_state_sys_id = current.variables.AnsState; var gr = new GlideRecord('item_option_new'); gr.addQuery('name',ans_state_sys_id); gr.addQuery('cat_item','sys Id of catalog item'); gr.query(); if(gr.next()){ var ans = gr.sys_id.toString() }
Please mark my response as correct and helpful if it helped solved your question.
-Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2019 02:39 PM
FYI the variable type is a Yes/No if that makes a difference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2019 02:55 PM
Can we try something like this?
var gateway = current.variables.Gateway.getValue(); var ritm_sys_id = current.sys_id.getValue(); var ritm = current.number.getValue(); var ans_state_sys_id = current.variables.AnsState; var gr = new GlideRecord('item_option_new'); gr.addQuery('name',ans_state_sys_id); gr.addQuery('cat_item','sys Id of catalog item'); gr.query(); if(gr.next()){ var ans = gr.sys_id.toString() }
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2019 02:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2019 02:59 PM