- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2022 10:52 PM
Hello,
I would like to query the flow context's sys_id on one of record producer. I tried with below script.
var flow = new GlideRecord('sys_flow_context');
flow.addQuery("source_record", "349dff2d1b0f591037e598aebd4bcbcf");
flow.query();
gs.info(flow.sys_id);
But the result I got is
*** Script: undefined
Can anyone help to advise?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2022 11:46 PM
you should use next() function to print
var flow = new GlideRecord('sys_flow_context');
flow.addQuery("source_record", "349dff2d1b0f591037e598aebd4bcbcf");
flow.query();
flow.next();
gs.info(flow.sys_id);
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2022 11:46 PM
you should use next() function to print
var flow = new GlideRecord('sys_flow_context');
flow.addQuery("source_record", "349dff2d1b0f591037e598aebd4bcbcf");
flow.query();
flow.next();
gs.info(flow.sys_id);
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader