Flow Designer Action with Powershell Step - How to configure Outputs

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2019 12:20 AM
Hi 🙂
I'm trying to prepare for automations using Powershell Steps in Flow Designer\IntegrationHub and I have managed to create a simple step that is already successful in some ways, it's running on the MID Server and executing. But I want to figure out how to configure Outputs in this Action that I'm creating, to get back some specific values. Lets say I just want to retrieve the status of a Service running on a Windows Server. I would like to get only the status back, and not having to parse anything, is that possible?
- Labels:
-
Integrations
-
Scripting and Coding
- 5,614 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2020 12:30 PM
Hello Morten!
At the time I'm writing this, it's been 11 months since you posted this question, and it's had 289 Views.
It's the exact same question I have, but I've not been able to find an answer anywhere. The ServiceNow documentation continues to be severely lacking regarding how to use to the Output variables with the PowerShell Step when creating a custom Action.
Were you able to find an answer regarding how to set an Output variable? Any help that anyone can provide would be priceless.
Thanks! 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2020 06:37 AM
Hello Community!
So I did some futz'ing around and I believe I figured out a way to get data (as a String) as an Output to pass to further Actions in the Flow Designer! It's not the best scenario, but at least it's something! 🙂
Here's what I did:
- I noticed that on the right side of the screen, where the variables for each Step are listed, that there already were three variables set:
- I figured that these variables are already plugged into particular output streams, like standard output and standard error (I'm not really up on my Windows output streams).
- Assuming this, then maybe any output normally written to the screen would appear in the Output variable. Here are the steps that I used to test this theory:
- I wrote this code as a test: Write-Host "TESTING OUTPUT FOR POWERSHELL ACTION"
- Then, I clicked on Outputs on the left, and created an Output variable named data.
- Then I mapped the data variable, using the Data Pill Picker, to the PowerShell Step's Output variable.
- Profit! 😄
- I set the Output variable to be a String because it was the logical choice if it is being sent all of the characters that are going to the screen, but you can probably tinker around with that and see if you can get other data types to work.
- To get multiple strings as output, just separate the output using a delimiter, and then parse the string on the other side.
This fulfilled my needs a the moment, so I didn't go any further, but I'm sure there will be a day where I'll need more, like a File to be passed to the next Action to attach to a record.
~Michael Zgleszewski

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2021 09:38 AM
Thanks for replying on this old post,
My problem, is where the heck do I see the Output after running a test? This flow designer is really difficult to navigate, and my test is successful (in that it ran with no errors), but I can't seem to find where my output would be. Any help would be most appreciated!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2024 02:02 AM
thank you @Michael Zglesze this helped