- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2020 05:01 PM
Hello,
I have following Run script in Workflow which doesn't execute properly. I have confirmed that the scratchpad variable is assigned to sysid2 variable properly, but GlideRecord query fails and doesn't update the record.
Now the same code works just fine on script background. Not sure what is going on. Where can I look for possible issues?
Please advise.
Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2020 05:43 PM
Can you try with this.
workflow.info("Scratchpad Value is = " + workflow.scratchpad.sysId.toString());
var sysid2 = workflow.scratchpad.sysId.toString();
Observe these logs in Workflow ==> Executing Activities whether it is able to display the above log.
Example
Please mark it as correct answer if it helps.
Thanks,
Narsing

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2020 05:09 PM
Hi, Can you try placing a log few logs in the run script specially on sysid2 and inside if statement. Please share what you get in the logs.
Also, try passing a static sys_id in the run script as well, and if that works. That will ensure whether the issue is with the scratchpad variable or anywhere else.
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2020 06:09 PM
Thanks Muhammad for your time.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2020 05:43 PM
Can you try with this.
workflow.info("Scratchpad Value is = " + workflow.scratchpad.sysId.toString());
var sysid2 = workflow.scratchpad.sysId.toString();
Observe these logs in Workflow ==> Executing Activities whether it is able to display the above log.
Example
Please mark it as correct answer if it helps.
Thanks,
Narsing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2020 06:08 PM
Thanks Narsing. That did the trick.
Wonder why, it was working fine all these time and all of a sudden had a need to change scratchpad variable to String.
Is it something changed during version? This WF was working fine since Istanbul version and now we are on Newyork.