
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2018 02:17 PM
Hello,
I have read a few ServiceNow articles and it appears you can get/pass Request Item variables to the Workflow Scratchpad OOB. Anyway having a problem or missing why I am not getting the value to the scratchpad.
So, on the sc_cat_item table, I created a new column called Manager Approval (u.manager.approval) [True/False]. This way on all our current catalog items a catalog admin can select if the Catalog item requires Manager Approval. In my workflow, I have the below IF condition to look to see if the Catalog item has the 'Manager Approval' checkbox set to True or False. But my workflow.scratchpad.u_manager_approval the variable is undefined. Am I missing something?
answer = ifScript();
var manApp = workflow.scratchpad.u_manager_approval;
//var manApp = current.variable_pool.u_manager_approval;
gs.info('manApp Value: ' + manApp); // returns 'undefined'
function ifScript() {
if (manApp == true) {
return 'yes';
}
return 'no';
}
gs.info('Answer Value: ' + answer); // returns 'no'
Here is an article that I referenced:
https://community.servicenow.com/community?id=community_question&sys_id=ddc013a9dbdcdbc01dcaf3231f9619f7
Thank you,
-Wesley
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2018 07:03 AM
I get it now, you can do this through filter condition, doesn't require scripting, like below, to check if manager field is true then if activity will return true else it will return false.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2019 01:39 PM
Wesley,
I'm not sure if you have figured out your approval answer but I had the same problem where the workflow burn pass the approval.
I had to get the sys_id of the user reference then set the approval answer to the sysID.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2018 01:09 PM
Hi Shishir,
My bad, I assumed and should have looked that the table for the field. Thanks!
-Wesley