- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2025 01:07 AM
Say suppose ,there are two run script activities in a WF , i need one value of a variable from run script 1 into the run script 2 how i can do that in workflow ??? |
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2025 01:38 AM
if you want to use any variable globally in workflow then you need to use workflow scratchpad variable
you need to store the value in workflow scratchpad variable and then access it
Run Script 1
workflow.scratchpad.approver = userSysId;
Run Script 2 - access the value
var approver = workflow.scratchpad.approver;
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2025 09:31 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2025 01:16 AM - edited 06-16-2025 01:41 AM
Hi @gaikwadshre ,
Use workflow.scratchpad
// Example: setting a value in script 1
workflow.scratchpad.myValue = 'Script 1';
Script 2:
var testValue=workflow.scratchpad.myValue
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Arun Manoj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2025 01:38 AM
if you want to use any variable globally in workflow then you need to use workflow scratchpad variable
you need to store the value in workflow scratchpad variable and then access it
Run Script 1
workflow.scratchpad.approver = userSysId;
Run Script 2 - access the value
var approver = workflow.scratchpad.approver;
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2025 09:31 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader