How can I get the output from a custom powershell activity to show in another activity further in the workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2017 10:28 AM
Within the custom PS activity, I set up the variable to output: Write-Host "$($DPW)". The next activity is a notification where I need to take the output (dpw) and send in an email. I've tried several things within the notification with no success:
${activityOutput.result}
${activityOutput.dpw}
${dpw}
Every way I try it, I always get blank output.
I put logging into place so that I know I'm getting the correct output, I just can't get it to show up in the next activity.
Thanks in advance for your assistance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2017 07:30 PM
Hi Chad,
Store the output of custom powershell activity into scratchpad variable and use that scratchpad variable in next activity.
Using the Workflow Scratchpad - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2017 10:34 AM
Hi Gurpreet,
I've looked through the documentation and I'm not finding any hard and fast rule that gives me what I need, so I'm kind of winging it. What I've done is add:
workflow.scratchpad.dpw = activityOutput.dpw;
to the post processing script, but now when it runs, I get an error: "Cannot set property "dpw" of undefined to [output value].
Any ideas?
Thanks,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2020 10:47 AM
Check this out:
https://community.servicenow.com/community?id=community_question&sys_id=69440f29dbd8dbc01dcaf3231f9619cd

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2019 10:16 PM
Hi Chad
Did you ever work this out?
I'm tearing my hair out trying to do the same thing.