Workflow ScratchPad Variables and retrieval
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2020 09:56 AM
Hi there,
I have read what I can in the realm of ScratchPad variables and uses, and here is what I required, hoping that some one out there has the elusive answer.
I have a workflow with and if statement before a group approval, where I populate the scratchpad variable, and this all works fine.
answer = checkVariable();
function checkVariable() {
if (current.variables.v_sn_iir.getGlideObject().getValue() == 'true' || current.variables.v_sn_wfl.getGlideObject().getValue() == 'true' || current.variables.v_sn_ncl.getGlideObject().getValue() == 'true' || current.variables.v_sn_fa.getGlideObject().getValue() == 'true') {
workflow.scratchpad.var_iir = 'IIR / WFL / NCL / Facility Audits';
gs.log('IIR / WFL / NCL / Facility Audits SCRATCHPAD: ' + workflow.scratchpad.var_iir);
return 'yes';
}
return 'no';
}
Now, I know the scratchpad variable contains the text, as per the gs.log.
From there, I need to retrieve this text from that scratchpad variable and insert it into a field on the approval form.
OnLoad Script on approval form is:
var scratchIIR = workflow.scratchpad.var_iir;
g_form.setValue('u_ritm_approval_for', scratchIIR);
When I load the approval form, there is no value in the custom field (u_ritm_approval_for) I have created.
Any assistance would be greatly appreciated. Thanks in advance!
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2020 10:08 AM
workflow.scratchpad object works on server side
you have to use "workflow.scratchpad" object into your workflow activities .
you can also access "workflow.scratchpad" it on business rule, refer the doc link.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2020 10:09 AM
Hi Wade,
workflow.scratchpad will accessible only from the workflow. In your case I would suggest to store it on a field of RITM table. Once done you can use g_scratchpad() that would pass value from RITM to approval table.
Thanks,
Jaspal Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2025 06:02 PM - edited ‎03-11-2025 06:03 PM
If you want to view the variables stored in the workflow just open the workflow context from the ticket (under related links) and then go to options and "show xml". The scratchpad is visible right there.
'<scratchpad>{"variablename1":"variablevalue1","variablename2":"variablevalue2"}</scratchpad>'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2025 07:05 PM
Workflow.scratchpad object is working on Server Side.
If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.