Wait for condition is not working
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 12:13 PM
Hi all,
my wait for condition is not working in work flow if I am applying on import set table.
below is the script
// Set the variable 'answer' to true or false to indicate if the condition has been met or not.
var importvalue = new GlideRecord('sys_import_set');
importvalue.addQuery('sys_id',workflow.scratchpad.importsetsysid);
importvalue.addQuery('state','processed');
importvalue.query();
if(importvalue.next()){
gs.info(importvalue.state+"testing for new value");
answer = true;
}
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2025 02:50 AM
Hi,
Did you check whether the code reach inside the if condition?
Please print the value of workflow.scratchpad.importsetsysid and ensure it has the sys_id. Sometime you need to call toString() function to make it work. So, if you feel it has the correct sys_id then replace the line
importvalue.addQuery('sys_id',workflow.scratchpad.importsetsysid.toString());
Thank you,
Palani
Palani