- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2017 05:47 AM
Hi All,
I have a if workflow activity which will return yes or no based on scratchpad variable. but, unfortunately for one request the scratchpad variable is assigned with wrong value and it is creating odd results, so is there anyway to change the value in scratchpad variable using scripts so that the workflow will follow correct path after the update.
Thanks and regards'
Swamy
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2017 06:48 AM
i have used below script to update scratchpad variables and it worked.
var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id','');
gr.query();
while(gr.next())
{
var wf = new Workflow().getRunningFlows(gr);
while(wf.next()) {
//new Workflow().broadcastEvent(wf.sys_id, 'pause');
wf.scratchpad.i = '23';
wf.update();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2017 06:48 AM
i have used below script to update scratchpad variables and it worked.
var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id','');
gr.query();
while(gr.next())
{
var wf = new Workflow().getRunningFlows(gr);
while(wf.next()) {
//new Workflow().broadcastEvent(wf.sys_id, 'pause');
wf.scratchpad.i = '23';
wf.update();
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2017 07:04 AM
Nice work!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2017 05:58 AM
yes..you can always change the workflow scratchpad variable. Check for Run script which will usually populates the scratchpad variables. Please change on your variable.
workflow.scratchpad.variable name.