Flow Designer - PowerShell Step - Ignore Errors

TJ29
Tera Contributor

Hi 

I've got a catalog item that captures information for creating AD groups in a multi row variable set. Upon approval, the variable set is then converted into a CSV via a UI action ready for someone to run a script against it. This has been running for a while now and works well. The next step is to automate this...

I've setup a custom action to send the CSV file to a location on the MID server and then another custom script to create the AD groups. The script works perfectly fine directly in PS via the MID and for the most part it works when executed via Flow Designer > MID Server. The only issue is that when it throws out errors for empty cells in the csv, it errors out the action and the flow dies. 

So the question is...how do I get ServiceNow/the action to IGNORE the errors it throws back and to just carry on?

04/13/22 15:01:49 (833) Worker-Expedited:IPaaSActionProbe-35b6585e1b324510d4eba75b234bcb29 DEBUG: Execution status: failed
04/13/22 15:01:49 (833) Worker-Expedited:IPaaSActionProbe-35b6585e1b324510d4eba75b234bcb29 SEVERE *** ERROR *** Cannot find an object with identity: '' under: 'DC=XYZ,DC=local'.
04/13/22 15:01:49 (833) Worker-Expedited:IPaaSActionProbe-35b6585e1b324510d4eba75b234bcb29 SEVERE *** ERROR *** Operation(AD Group Request Creation.7ea6d45e1b324510d4eba75b234bcbfa.ecea805a1bfe0510d4eba75b234bcbfa) failed with error: com.snc.process_flow.exception.OpException: Powershell execution error

Any help would be greatly appreciated - thank you!

5 REPLIES 5

Bimschleger
ServiceNow Employee
ServiceNow Employee

Glad to hear that this helped. Feel free to reach out if you have any issues with error handling or ideas on how we could improve it.