Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Powershell step in custom Action in Flow Designer error handling

Devon Chopp
Giga Contributor

This is my first attempt at creating a custom Action in Flow Designer to do some automation with one of our catalog items when it is submitted. It is a name change powershell script which will update Exchange and AD based on inputs provided. My issue is that when testing the powershell step, it errors on the first line of code, which I expect and I know how to fix, my problem is that the test returns a step status of 0 successful even though the powershell script itself threw back an error. The Error Message and Windows Error code fields get populated, but not with something as simple as 1 for error 0 for success that I could easily use in the Error Evaluation portion so that I could then trigger a task to be created if it saw that the action ran into an error so that the fulfillers can manually take a look and fix the issue. Has anyone been able to get the step status for a Powershell step to return any sort of meaningful error result or a way to set the step result to 1 if an error occurs in the Powershell code itself?

0 REPLIES 0