- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2024 01:22 AM
How to get custom table record from previous run script of workflow which we have inserted
eg: insertion of record in custom table:
var gr = new GlideRecord('u_c_table');
gr.initialize();
gr.u_requested_for = current.variables.user;
gr.u_status = 'waiting for approval';
gr.u_date = gs.nowDateTime();
gr.insert();
I need to update this records status in next run script of workflow, Any help is appreciated. Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2024 01:32 AM
For this you can use workflow scratchpad, the workflow scratchpad is available throughout the workflow cycle. So in your script you can try this
var gr = new GlideRecord('u_c_table');
gr.initialize();
gr.u_requested_for = current.variables.user;
gr.u_status = 'waiting for approval';
gr.u_date = gs.nowDateTime();
gr.insert();
workflow.scratchpad.recordID= gr.sys_id;
now in another script or activity you can use this scratchpad.
https://www.servicenow.com/community/itsm-forum/workflow-scratchpad/m-p/509877
Regards,
Piyush Sain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2024 01:32 AM
For this you can use workflow scratchpad, the workflow scratchpad is available throughout the workflow cycle. So in your script you can try this
var gr = new GlideRecord('u_c_table');
gr.initialize();
gr.u_requested_for = current.variables.user;
gr.u_status = 'waiting for approval';
gr.u_date = gs.nowDateTime();
gr.insert();
workflow.scratchpad.recordID= gr.sys_id;
now in another script or activity you can use this scratchpad.
https://www.servicenow.com/community/itsm-forum/workflow-scratchpad/m-p/509877
Regards,
Piyush Sain